 | GeneratorApplyTSource Method |
Makes a generator that applies a function on the elements it generates.
Namespace:
Gamelogic.Extensions.Algorithms
Assembly:
Assembly-CSharp (in Assembly-CSharp.dll) Version: 0.0.0.0
Syntax
Exceptions
Examples
The following will generate a generator that generates
0 1 2 3 0 1 2 ... and print the values to the console.
var generator = Generator.Count(4).Apply((x) => {Debug.Log(x);});
The following will generate a monster, and sets its properties based on the
player's current level:
var monsterGenerator = Generator
.Constant(monsterTemplate)
.Apply(m => m.SetProperties(GetPlayerLevel());
See Also