Class ConsistentRandom
- Namespace
- Core.Randomizing
- Assembly
- Core.dll
public class ConsistentRandom
- Inheritance
-
objectConsistentRandom
- Extension Methods
Constructors
ConsistentRandom(int)
public ConsistentRandom(int seed)
Parameters
seedint
ConsistentRandom(string)
public ConsistentRandom(string seed)
Parameters
seedstring
Methods
Choice<T>(IReadOnlyList<T>)
public T Choice<T>(IReadOnlyList<T> array)
Parameters
arrayIReadOnlyList<T>
Returns
- T
Type Parameters
T
Next(int, int)
public int Next(int minValue, int maxValue)
Parameters
minValueintmaxValueint
Returns
- int
NextFloat()
[Obsolete("Don't use RNG with floats, this is not deterministic")]
public float NextFloat()
Returns
- float
NextFloatRange(float, float)
[Obsolete("Don't use RNG with floats, this is not deterministic")]
public float NextFloatRange(float min, float max)
Parameters
minfloatmaxfloat
Returns
- float
NextInt()
public int NextInt()
Returns
- int
SetSeed(int)
public void SetSeed(int seed)
Parameters
seedint
Shuffle<T>(IList<T>)
public void Shuffle<T>(IList<T> list)
Parameters
listIList<T>
Type Parameters
T
StringToHash(string)
public static uint StringToHash(string seed)
Parameters
seedstring
Returns
- uint
TestPerMille(int)
public bool TestPerMille(int probabilityPerMille)
Parameters
probabilityPerMilleint
Returns
- bool
TestPercentage(int)
public bool TestPercentage(int probability)
Parameters
probabilityint
Returns
- bool