Table of Contents

Method SwitchAfter

Namespace
Gamelogic.Extensions.Algorithms
Assembly
Gamelogic.Extensions.dll

SwitchAfter<TSource>(IGenerator<TSource>, int, IGenerator<TSource>)

Generates elements from a source generator for the given number of steps, then switches to a second generator.

public static IGenerator<TSource> SwitchAfter<TSource>(this IGenerator<TSource> source, int steps, IGenerator<TSource> newGenerator)

Parameters

source IGenerator<TSource>

The source generator that will be used before the switch.

steps int

The number of steps before switching.

newGenerator IGenerator<TSource>

The new generator that will be used after the switch.

Returns

IGenerator<TSource>

A new generator.

Type Parameters

TSource

The type of the source generator.

Exceptions

ArgumentNullException

source is null

ArgumentNullException

newGenerator is null