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> initialSource, int steps, IGenerator<TSource> newSource)

Parameters

initialSource IGenerator<TSource>

The source generator that will be used before the switch.

steps int

The number of steps before switching.

newSource 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