Click or drag to resize

GeneratorChooseTSource Method (IListTSource, IGeneratorInt32)

Makes a generator that chooses elements from a list using an index generator.

Namespace:  Gamelogic.Extensions.Algorithms
Assembly:  Assembly-CSharp (in Assembly-CSharp.dll) Version: 0.0.0.0
Syntax
C#
public static IGenerator<TSource> Choose<TSource>(
	IList<TSource> source,
	IGenerator<int> indexGenerator
)

Parameters

source
Type: System.Collections.GenericIListTSource
The source list.
indexGenerator
Type: Gamelogic.Extensions.AlgorithmsIGeneratorInt32
The index generator.

Type Parameters

TSource
The type of elements to generate.

Return Value

Type: IGeneratorTSource
A new generator.
Exceptions
ExceptionCondition
ArgumentNullException list or indexGenerator
ArgumentExceptionList must have at least one element;list
Examples
The following will generate "cat" "dog" "cat" "dog":
var generator = Generator.Choose(new[] {"cat", "dog"}, Generator.Count(2));
See Also