Click or drag to resize

GeneratorAggregateTSource Method (IGeneratorTSource, FuncTSource, TSource, TSource, TSource)

Makes a generator that generates a running aggregate of the source generator.

Namespace:  Gamelogic.Extensions.Algorithms
Assembly:  Assembly-CSharp (in Assembly-CSharp.dll) Version: 0.0.0.0
Syntax
C#
public static IGenerator<TSource> Aggregate<TSource>(
	this IGenerator<TSource> generator,
	Func<TSource, TSource, TSource> aggregator,
	TSource initialValue
)

Parameters

generator
Type: Gamelogic.Extensions.AlgorithmsIGeneratorTSource
The source generator.
aggregator
Type: SystemFuncTSource, TSource, TSource
The aggregator.
initialValue
Type: TSource
The initial value.

Type Parameters

TSource
The type of elements of the source generator.

Return Value

Type: IGeneratorTSource
A new generator.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IGeneratorTSource. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
Remarks
The resulting generator will generate the following sequence: result0 = aggregator(initialValue, generator[0])result1 = aggregator(result0, generator[1])result2 = aggregator(result1, generator[2])
See Also