Generator Class |
Namespace: Gamelogic.Extensions.Algorithms
[VersionAttribute(2, 0, 0)] public static class Generator
The Generator type exposes the following members.
| Name | Description | |
|---|---|---|
| AggregateTSource(IGeneratorTSource, FuncTSource, TSource, TSource) |
Makes a generator that generates a running aggregate of the source generator.
| |
| AggregateTSource(IGeneratorTSource, FuncTSource, TSource, TSource, TSource) |
Makes a generator that generates a running aggregate of the source generator.
| |
| AggregateTSource, TResult(IGeneratorTSource, FuncTResult, TSource, TResult, TResult) |
Makes a generator that generates a running aggregate of the source generator.
| |
| ApplyTSource |
Makes a generator that applies a function on the elements it generates.
| |
| Average(IGeneratorInt32) |
Makes a generator the will generate the average of elements generated by another generator.
| |
| Average(IGeneratorSingle) |
Makes a generator the will generate the average of elements generated by another generator.
| |
| CastTResult |
Makes a generator that will generate elements by casting the elements of a source
generator.
| |
| ChooseTSource(IListTSource, IGeneratorInt32) |
Makes a generator that chooses elements from a list using an index generator.
| |
| ChooseTSource(IListIGeneratorTSource, IGeneratorInt32) |
Makes a generator that uses an index generator to choose a generator to
generate an element from.
| |
| ChooseUniformRandomTSource(IListTSource) |
Make a generator that randomly generates elements from a list.
| |
| ChooseUniformRandomTSource(IGeneratorTSource) | Obsolete.
Chooses the from the given generators selected uniform randomly.
| |
| ChooseUniformRandomTSource(IListIGeneratorTSource) |
Makes a generator that selects a random generator from a given element to generate an element from.
| |
| ChooseUniformRandomTSource(IListTSource, Int32) |
Make a generator that randomly generates elements from a list. Can be seeded.
| |
| ChooseUniformRandomTSource(IListIGeneratorTSource, Int32) |
Chooses the random.
| |
| ClosedSawTooth |
Makes a generator that produces evenly spaced floats from 0 to 1, both limits included, and repeats the result.
| |
| CombineTSource, TResult(IEnumerableIGeneratorTSource, FuncIListTSource, TResult) |
Makes a generator that combines the elements of specified generators.
| |
| CombineT1, T2, TResult(IGeneratorT1, IGeneratorT2, FuncT1, T2, TResult) |
Combines the specified generators by applying a result selector
function to the elements of each generator.
| |
| CombineT1, T2, T3, TResult(IGeneratorT1, IGeneratorT2, IGeneratorT3, FuncT1, T2, T3, TResult) |
Combines the specified generators by applying a result selector
function to the elements of each generator.
| |
| CombineT1, T2, T3, T4, TResult(IGeneratorT1, IGeneratorT2, IGeneratorT3, IGeneratorT4, FuncT1, T2, T3, T4, TResult) |
Combines the specified generators by applying a result selector
function to the elements of each generator.
| |
| ConstantTSource |
Makes a generator that generates a the same item each time.
| |
| Count |
Makes a generator that generates consecutive integers starting from zero up to a limit, and repeats the cycle.
| |
| Dither |
Takes the source generator's output, and generate a dithered sequence of integers
in the range 0 to levels - 1. Uses error diffusion.
| |
| FrequencyRandomInt(IEnumerableSingle) |
Generates random integers at relative frequencies provided.
| |
| FrequencyRandomInt(IEnumerableSingle, Int32) |
Generates random integers at relative frequencies provided.
| |
| FromFuncTResult |
Makes a new generator from a generator function.
| |
| GaussianRandomFloat |
Makes a generator that generates floats with a Gaussian distribution.
| |
| GroupTSource(IGeneratorTSource, IGeneratorInt32) |
Makes a generator that generates groups of items from the source generator.
| |
| GroupTSource(IGeneratorTSource, Int32) |
Makes a generator that returns groups of elements from the source generator.
| |
| InterleaveTSource(IListIGeneratorTSource) |
Makes a generator that interleaves the elements of the specified generators.
| |
| InterleaveTSource(IGeneratorTSource, IGeneratorTSource) |
Makes a generator that interleaves the elements of the specified generators.
| |
| InterpolateTSource(IGeneratorTSource, IGeneratorInt32, FuncTSource, TSource, Single, TSource) |
Makes a generator that interpolates between values of a given generator.
| |
| InterpolateTSource(IGeneratorTSource, Int32, FuncTSource, TSource, Single, TSource) |
Makes a generator that interpolates between values of a given generator.
| |
| InterpolateDitherTSource |
Interpolates a sequence, but applies dithering.
| |
| IterateTSource(IEnumerableTSource, FuncIListTSource, TSource) |
Makes a generator that uses an iterator function to generate elements.
| |
| IterateTSource(TSource, FuncTSource, TSource) |
Makes a generator that returns iterations of the specified initial element.
| |
| IterateTSource(TSource, TSource, FuncTSource, TSource, TSource) |
Makes a generator that uses an iterator function to generate elements.
| |
| IterateTSource(TSource, TSource, TSource, FuncTSource, TSource, TSource, TSource) |
Makes a generator that uses an iterator function to generate elements.
| |
| IterateTSource(TSource, TSource, TSource, TSource, FuncTSource, TSource, TSource, TSource, TSource) |
Makes a generator that uses an iterator function to generate elements.
| |
| IterateTSource, TSource2(TSource, IGeneratorTSource2, FuncTSource, TSource2, TSource) |
Applies a function on the last element to produce the next element. The function
takes twp parameters; the second parameter is supplied by a generator.
| |
| LogTSource(IGeneratorTSource) |
A generator that generates the elements of the source generator, but sends the generated element to the Unity Console.
| |
| LogTSource(IGeneratorTSource, ActionTSource) |
A generator that generates the elements of the source generator, but applies a log function to each element as it is generated.
| |
| MarkovRandomInt(Single) |
Generates a Markov chain of integers from a transition table.
| |
| MarkovRandomInt(Single, Int32) |
Generates a Markov chain of integers from a transition table.
| |
| MarkovRandomIntStartsWith(Single, Int32) |
Makes a Markov generator that starts with the given value.
| |
| MarkovRandomIntStartsWith(Single, Int32, Int32) |
Makes a Markov generator that starts with the given value.
| |
| MoveNextTSource |
Moves the generator by a specified amount forward.
| |
| NextTSource(IGeneratorTSource) |
Returns the next element of the specified generator.
| |
| NextTSource(IGeneratorTSource, Int32) |
Returns a list of the next n items from the generator.
| |
| NextWhileTSource |
Generates the elements from the generator while the predicate applied to elements
hold an return them in an enumerable. After calling this method,
the next element returned by Next (or the current value of Current) will not satisfy
the predicate.
| |
| OfTypeTResult |
Makes a generator that will generate elements of a source generator that is
of the given type.
| |
| OpenSawTooth(Int32) |
Makes a generator that produces evenly spaced floats from 0 (included)
to 1 (excluded), and repeats the result.
| |
| OpenSawTooth(IGeneratorInt32) |
Makes a generator that produces evenly spaced floats from 0 (included)
to 1 (excluded), and repeats the result (but with the number of samples
each time given by a generator).
| |
| PadTSource(IGeneratorTSource, IEnumerableTSource) |
Pads the specified generator with elements from a given list.
| |
| PadTSource(IGeneratorTSource, TSource, Int32) |
Pads the specified generator with a constant element repeated a specified number of times.
| |
| Poisson |
A boolean generator that returns true at intervals uniformly distributed between
minRadius and maxRadius.
| |
| RandomBoolGenerator(Single) |
Makes a generator that returns random boolean values, true with the specified
probability.
| |
| RandomBoolGenerator(Single, Int32) |
Makes a generator that returns random boolean values, true with the specified
probability.
| |
| RepeatTSource |
Makes a generator that repeats elements of the given list over and over.
| |
| RepeatEachTSource(IGeneratorTSource, IGeneratorInt32) |
Makes a new generator that will repeat each of the given generators
elements a number of times.
| |
| RepeatEachTSource(IGeneratorTSource, Int32) |
Makes a new generator that will repeat each of the given generators
elements a number of times.
| |
| SelectTResult(IGeneratorSingle, ResponseCurveBaseTResult) |
Makes a new generator by transforming the elements of a given
float generator using a response curve.
| |
| SelectTSource, TResult(IGeneratorTSource, FuncTSource, TResult) |
Makes a generator which generates items that are transformed, generated from a given generator.
| |
| SelectManyTSource, TResult |
For each item in the source generator, a list of items is generated, but the items are generated
one by one (and not as a list of items).
| |
| SkipTSource |
Makes a generator that skips over the specified number of elements from the source generator.
| |
| SkipAndTakeTSource |
Makes a generator that repeatedly skips over and takes elements from a given generator.
| |
| Sum(IGeneratorInt32) |
Makes a generator that will generate partial sums of a given generator.
| |
| Sum(IGeneratorSingle) |
Makes a generator that will generate partial sums of a given generator.
| |
| SwitchAfterTSource |
Generates elements from a source generator for
the given number of steps, then switches to a second generator.
| |
| SwitchWhenTSource |
Generates elements from the source generator until a condition is met,
then generate elements from a second generator.
| |
| TakeAndSkipTSource |
Makes a generator that repeatedly takes and skips over elements from a given generator.
| |
| UniformRandomFloat |
Makes a generator hat generates floats uniformly between 0 and 1.
| |
| UniformRandomFloat(Int32) |
Makes a generator that generates floats uniformly between 0 and 1.
| |
| UniformRandomInt(Int32) |
Makes a generator that generates integers uniformly distributed between 0 (included) and
the specified limit (excluded).
| |
| UniformRandomInt(Int32, Int32) |
Makes a generator hat generates integers uniformly distributed between 0 (included) and
the specified limit (excluded).
| |
| UniformVector2InCircle |
Generates vectors uniformly distributed in a given circle.
| |
| UniformVector2InRect |
Generates vectors uniformly distributed in a given rectangle.
| |
| WhereTSource(IGeneratorTSource, IGeneratorBoolean) |
Makes a generator that will only generate elements that pass the predicate generated by the predicate generator.
| |
| WhereTSource(IGeneratorTSource, FuncTSource, Boolean) |
Makes a generator that will only generate elements that pass the predicate.
| |
| WhereT(IGeneratorT, IGeneratorBoolean, Int32) |
Makes a generator that will only generate elements that pass the predicate generated by
the predicate generator. If the source elements does not provide
elements that pass the predicate for the given number of maximum iterations, an exception is thrown.
This is to prevent a stalling the generator forever.
| |
| WhereT(IGeneratorT, FuncT, Boolean, Int32) |
Makes a generator that will only generate elements that pass the predicate. If the source elements does not provide
elements that pass the predicate for the given number of maximum iterations, an exception is thrown.
This is to prevent a stalling the generator forever.
| |
| WhereWindowTSource |
Only generates an item if the window of the item passes the predicate.
| |
| WindowTSource |
Makes a generator that generates a moving window of elements over a given generator.
|