Method RepeatEach
- Namespace
- Gamelogic.Extensions.Algorithms
- Assembly
- Gamelogic.Extensions.dll
RepeatEach<TSource>(IGenerator<TSource>, IGenerator<int>)
Makes a new generator that will repeat each of the given generators elements a number of times.
public static IGenerator<TSource> RepeatEach<TSource>(this IGenerator<TSource> generator, IGenerator<int> repeatCountGenerator)
Parameters
generatorIGenerator<TSource>The source generator.
repeatCountGeneratorIGenerator<int>A generator used to get the number of times each element will be generated.
Returns
- IGenerator<TSource>
A new generator.
Type Parameters
TSourceThe type of the elements of the source generator.
Exceptions
- ArgumentNullException
generator- ArgumentNullException
repeatCountGeneratoris null.
RepeatEach<TSource>(IGenerator<TSource>, int)
Makes a new generator that will repeat each of the given generators elements a number of times.
public static IGenerator<TSource> RepeatEach<TSource>(this IGenerator<TSource> generator, int repeatCount)
Parameters
generatorIGenerator<TSource>The source generator.
repeatCountintThe number of times each element will be generated.
Returns
- IGenerator<TSource>
A new generator.
Type Parameters
TSourceThe type of the elements of the source generator.
Exceptions
- ArgumentNullException
generatoris null- ArgumentOutOfRangeException
repeatCountis not positive.