Method FromFunc
- Namespace
- Gamelogic.Extensions.Algorithms
- Assembly
- Gamelogic.Extensions.dll
FromFunc<TResult>(Func<TResult>)
Makes a new generator from a generator function.
public static IGenerator<TResult> FromFunc<TResult>(Func<TResult> generator)
Parameters
generator
Func<TResult>The generator function that will be called to generate new elements.
Returns
- IGenerator<TResult>
Type Parameters
TResult
The type of elements to generate.
Exceptions
- ArgumentNullException
generator