 | GeneratorSkipAndTakeTSource Method |
Makes a generator that repeatedly skips over and takes elements from a given generator.
Namespace:
Gamelogic.Extensions.Algorithms
Assembly:
Assembly-CSharp (in Assembly-CSharp.dll) Version: 0.0.0.0
Syntaxpublic static IGenerator<TSource> SkipAndTake<TSource>(
this IGenerator<TSource> generator,
int skipCount,
int takeCount
)
Parameters
- generator
- Type: Gamelogic.Extensions.AlgorithmsIGeneratorTSource
The source generator. - skipCount
- Type: SystemInt32
The number of elements to skip each cycle. - takeCount
- Type: SystemInt32
The number of elements to take each cycle.
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
Examples The following generator will generate 0 1 2 4 5 6 8 9 10...
var generator = Generator
.Count(100)
.TakeAndSkip(3, 1);
See Also