Click or drag to resize

GeneratorPadTSource Method (IGeneratorTSource, TSource, Int32)

Pads the specified generator with a constant element repeated a specified number of times.

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

Parameters

generator
Type: Gamelogic.Extensions.AlgorithmsIGeneratorTSource
The source generator.
padding
Type: TSource
The padding value.
padCount
Type: SystemInt32
The number of values to pad.

Type Parameters

TSource
The type of elements to generate.

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).
Examples
var generator = Generator.Count(4).Pad(0, 3);
//will generate 0 0 0 0 1 2 0 1 2 ...
See Also