PCG32 random generator, 16 bytes in size. http://www.pcg-random.org More...
Inherits INetworkStruct.
Public Member Functions | |
NetworkRNG (Int32 seed) | |
Creates a new instance of NetworkRNG with a random seed. More... | |
double | Next () |
Generates a random double value within the inclusive range [0, 1]. More... | |
double | NextExclusive () |
Generates a random double value within the exclusive range [0, 1). More... | |
int | NextInt32 () |
Generates a random integer value within the range of int.MinValue to int.MaxValue. More... | |
float | NextSingle () |
Generates a random float value within the inclusive range [0, 1]. More... | |
float | NextSingleExclusive () |
Generates a random float value within the exclusive range [0, 1). More... | |
uint | NextUInt32 () |
Generates a random unsigned integer value within the range of 0 to uint.MaxValue. More... | |
Int32 | RangeExclusive (Int32 minInclusive, Int32 maxExclusive) |
Returns a random Int32 within [minInclusive, maxExclusive) (range is exclusive). If minInclusive and maxExclusive are equal, then the "exclusive rule" is ignored and minInclusive will be returned. If minInclusive is greater than maxExclusive, then the numbers are automatically swapped. More... | |
UInt32 | RangeExclusive (UInt32 minInclusive, UInt32 maxExclusive) |
Returns a random UInt32 within [minInclusive, maxExclusive) (range is exclusive). If minInclusive and maxExclusive are equal, then the "exclusive rule" is ignored and minInclusive will be returned. If minInclusive is greater than maxExclusive, then the numbers are automatically swapped. More... | |
Double | RangeInclusive (Double minInclusive, Double maxInclusive) |
Returns a random Double within [minInclusive, maxInclusive] (range is inclusive). If minInclusive is greater than maxInclusive, then the numbers are automatically swapped. More... | |
Int32 | RangeInclusive (Int32 minInclusive, Int32 maxInclusive) |
Returns a random Int32 within [minInclusive, maxInclusive] (range is inclusive). If minInclusive is greater than maxInclusive, then the numbers are automatically swapped. More... | |
Single | RangeInclusive (Single minInclusive, Single maxInclusive) |
Returns a random Single within [minInclusive, maxInclusive] (range is inclusive). If minInclusive is greater than maxInclusive, then the numbers are automatically swapped. More... | |
UInt32 | RangeInclusive (UInt32 minInclusive, UInt32 maxInclusive) |
Returns a random UInt32 within [minInclusive, maxInclusive] (range is inclusive). If minInclusive is greater than maxInclusive, then the numbers are automatically swapped. More... | |
override string | ToString () |
String representation of the RNG state. More... | |
Static Public Attributes | |
const UInt32 | MAX = UInt32.MaxValue |
Maximum allowed value More... | |
const int | SIZE = 16 |
Size of the struct in bytes. More... | |
Properties | |
NetworkRNG | Peek [get] |
Returns the same RNG instance. More... | |
PCG32 random generator, 16 bytes in size. http://www.pcg-random.org
NetworkRNG | ( | Int32 | seed | ) |
Creates a new instance of NetworkRNG with a random seed.
seed | Seed value. |
double Next | ( | ) |
Generates a random double value within the inclusive range [0, 1].
double NextExclusive | ( | ) |
Generates a random double value within the exclusive range [0, 1).
int NextInt32 | ( | ) |
Generates a random integer value within the range of int.MinValue to int.MaxValue.
float NextSingle | ( | ) |
Generates a random float value within the inclusive range [0, 1].
float NextSingleExclusive | ( | ) |
Generates a random float value within the exclusive range [0, 1).
uint NextUInt32 | ( | ) |
Generates a random unsigned integer value within the range of 0 to uint.MaxValue.
Int32 RangeExclusive | ( | Int32 | minInclusive, |
Int32 | maxExclusive | ||
) |
Returns a random Int32 within [minInclusive, maxExclusive) (range is exclusive). If minInclusive and maxExclusive are equal, then the "exclusive rule" is ignored and minInclusive will be returned. If minInclusive is greater than maxExclusive, then the numbers are automatically swapped.
UInt32 RangeExclusive | ( | UInt32 | minInclusive, |
UInt32 | maxExclusive | ||
) |
Returns a random UInt32 within [minInclusive, maxExclusive) (range is exclusive). If minInclusive and maxExclusive are equal, then the "exclusive rule" is ignored and minInclusive will be returned. If minInclusive is greater than maxExclusive, then the numbers are automatically swapped.
Double RangeInclusive | ( | Double | minInclusive, |
Double | maxInclusive | ||
) |
Returns a random Double within [minInclusive, maxInclusive] (range is inclusive). If minInclusive is greater than maxInclusive, then the numbers are automatically swapped.
Int32 RangeInclusive | ( | Int32 | minInclusive, |
Int32 | maxInclusive | ||
) |
Returns a random Int32 within [minInclusive, maxInclusive] (range is inclusive). If minInclusive is greater than maxInclusive, then the numbers are automatically swapped.
Single RangeInclusive | ( | Single | minInclusive, |
Single | maxInclusive | ||
) |
Returns a random Single within [minInclusive, maxInclusive] (range is inclusive). If minInclusive is greater than maxInclusive, then the numbers are automatically swapped.
UInt32 RangeInclusive | ( | UInt32 | minInclusive, |
UInt32 | maxInclusive | ||
) |
Returns a random UInt32 within [minInclusive, maxInclusive] (range is inclusive). If minInclusive is greater than maxInclusive, then the numbers are automatically swapped.
override string ToString | ( | ) |
String representation of the RNG state.
|
static |
Maximum allowed value
|
static |
Size of the struct in bytes.
|
get |
Returns the same RNG instance.