Click or drag to resize

GeneratorIterateTSource Method (IEnumerableTSource, FuncIListTSource, TSource)

Makes a generator that uses an iterator function to generate elements.

Namespace:  Gamelogic.Extensions.Algorithms
Assembly:  Assembly-CSharp (in Assembly-CSharp.dll) Version: 0.0.0.0
Syntax
C#
public static IGenerator<TSource> Iterate<TSource>(
	IEnumerable<TSource> initialElements,
	Func<IList<TSource>, TSource> iterator
)

Parameters

initialElements
Type: System.Collections.GenericIEnumerableTSource
The initial elements.
iterator
Type: SystemFuncIListTSource, TSource
The iterator function.

Type Parameters

TSource
The type of elements to generate.

Return Value

Type: IGeneratorTSource
Exceptions
ExceptionCondition
ArgumentNullExceptioniterator
Remarks
Uses the last n elements to generate the next one, where n is the same number of elements as is provided initially.
See Also