 | GeneratorAggregateTSource Method (IGeneratorTSource, FuncTSource, 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
Syntaxpublic static IGenerator<TSource> Aggregate<TSource>(
this IGenerator<TSource> generator,
Func<TSource, TSource, TSource> aggregator
)
Parameters
- generator
- Type: Gamelogic.Extensions.AlgorithmsIGeneratorTSource
The source generator. - aggregator
- Type: SystemFuncTSource, TSource, TSource
The aggregator.
Type Parameters
- TSource
- The type of elements of the source generator.
Return Value
Type:
IGeneratorTSourceA 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).
Exceptions
RemarksThis overload uses the first item as the first element to generate.
The resulting generator will generate the following sequence:
result0 = generator[0]result1 = aggregator(result0, generator[1])result2 = aggregator(result1, generator[2])
See Also