Click or drag to resize

GeneratorAverage Method (IGeneratorInt32)

Makes a generator the will generate the average of elements generated by another generator.

Namespace:  Gamelogic.Extensions.Algorithms
Assembly:  Assembly-CSharp (in Assembly-CSharp.dll) Version: 0.0.0.0
Syntax
C#
public static IGenerator<int> Average(
	this IGenerator<int> generator
)

Parameters

generator
Type: Gamelogic.Extensions.AlgorithmsIGeneratorInt32
The generator.

Return Value

Type: IGeneratorInt32
A new generator.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IGeneratorInt32. 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
ExceptionCondition
ArgumentNullExceptionsource is null
Examples
The following generator will generate 4, 4, 4, 4, ....
var generator = Generator.Constant(4).Average()
See Also