Table of Contents

Class ConsistentRandom

Namespace
Core.Randomizing
Assembly
Core.dll
public class ConsistentRandom
Inheritance
object
ConsistentRandom
Extension Methods

Constructors

ConsistentRandom(int)

public ConsistentRandom(int seed)

Parameters

seed int

ConsistentRandom(string)

public ConsistentRandom(string seed)

Parameters

seed string

Methods

Choice<T>(IReadOnlyList<T>)

public T Choice<T>(IReadOnlyList<T> array)

Parameters

array IReadOnlyList<T>

Returns

T

Type Parameters

T

Next(int, int)

public int Next(int minValue, int maxValue)

Parameters

minValue int
maxValue int

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

min float
max float

Returns

float

NextInt()

public int NextInt()

Returns

int

SetSeed(int)

public void SetSeed(int seed)

Parameters

seed int

Shuffle<T>(IList<T>)

public void Shuffle<T>(IList<T> list)

Parameters

list IList<T>

Type Parameters

T

StringToHash(string)

public static uint StringToHash(string seed)

Parameters

seed string

Returns

uint

TestPerMille(int)

public bool TestPerMille(int probabilityPerMille)

Parameters

probabilityPerMille int

Returns

bool

TestPercentage(int)

public bool TestPercentage(int probability)

Parameters

probability int

Returns

bool