Class UniformRandomStream
Namespace: ValveResourceFormat.Utils
Assembly: ValveResourceFormat.dll
Seeded uniform random number generator (Park-Miller with a Bays-Durham shuffle).
csharp
public sealed class UniformRandomStreamInheritance
object ← UniformRandomStream
Constructors
UniformRandomStream()
Initializes a new instance of the UniformRandomStream class with a seed of zero.
csharp
public UniformRandomStream()UniformRandomStream(int)
Initializes a new instance of the UniformRandomStream class.
csharp
public UniformRandomStream(int seed)Parameters
seed int
Seed for the sequence.
Methods
RandomFloat(float, float)
Returns the next float in a range.
csharp
public float RandomFloat(float low = 0, float high = 1)Parameters
low float
Lower bound, inclusive.
high float
Upper bound, exclusive.
Returns
float
RandomInt(int, int)
Returns the next integer in a range, or low if the range is empty.
csharp
public int RandomInt(int low, int high)Parameters
low int
Lower bound, inclusive.
high int
Upper bound, inclusive.
Returns
int
SetSeed(int)
Restarts the sequence from a seed.
csharp
public void SetSeed(int seed)Parameters
seed int
Seed for the sequence.

