Method WhereWindow
- Namespace
- Gamelogic.Extensions.Algorithms
- Assembly
- Gamelogic.Extensions.dll
WhereWindow<TSource>(IGenerator<TSource>, int, Func<TSource[], bool>)
Only generates an item if the window of the item passes the predicate.
public static IGenerator<TSource> WhereWindow<TSource>(this IGenerator<TSource> generator, int windowSize, Func<TSource[], bool> predicate)
Parameters
generator
IGenerator<TSource>The generator.
windowSize
intSize of the window.
predicate
Func<TSource[], bool>The predicate.
Returns
- IGenerator<TSource>
IGenerator<TSource>.
Type Parameters
TSource
The type of the source generator.
Remarks
The window of an item is the element and a number of elements after the
element (together, the number of elements is windowSize
).
Exceptions
- ArgumentNullException
generator or predicate
- ArgumentOutOfRangeException
windowSize;Argument must be positive.