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> source)
Parameters
source
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