Table of Contents

Class AdvancedRandom

Namespace
Garyon.Objects.Advanced
Assembly
Garyon.dll

Provides a better alternative for the Random class, offering further functionality.

public class AdvancedRandom : Random
Inheritance
AdvancedRandom
Inherited Members
Extension Methods

Constructors

AdvancedRandom()

Initializes a new instance of the AdvancedRandom class, using a time-dependent default seed value.

public AdvancedRandom()

AdvancedRandom(byte)

Initializes a new instance of the AdvancedRandom class, using the specified seed value.

public AdvancedRandom(byte seed)

Parameters

seed byte

A number used to calculate a starting value for the pseudo-random number sequence.

AdvancedRandom(double)

Initializes a new instance of the AdvancedRandom class, using the specified seed value.

public AdvancedRandom(double seed)

Parameters

seed double

A number, whose hash code will be used to calculate a starting value for the pseudo-random number sequence.

AdvancedRandom(short)

Initializes a new instance of the AdvancedRandom class, using the specified seed value.

public AdvancedRandom(short seed)

Parameters

seed short

A number used to calculate a starting value for the pseudo-random number sequence. If a negative number is specified, the absolute value of the number is used.

AdvancedRandom(int)

Initializes a new instance of the AdvancedRandom class, using the specified seed value.

public AdvancedRandom(int seed)

Parameters

seed int

A number used to calculate a starting value for the pseudo-random number sequence. If a negative number is specified, the absolute value of the number is used.

AdvancedRandom(long)

Initializes a new instance of the AdvancedRandom class, using the specified seed value.

public AdvancedRandom(long seed)

Parameters

seed long

A number, whose hash code will be used to calculate a starting value for the pseudo-random number sequence.

AdvancedRandom(sbyte)

Initializes a new instance of the AdvancedRandom class, using the specified seed value.

public AdvancedRandom(sbyte seed)

Parameters

seed sbyte

A number used to calculate a starting value for the pseudo-random number sequence. If a negative number is specified, the absolute value of the number is used.

AdvancedRandom(float)

Initializes a new instance of the AdvancedRandom class, using the specified seed value.

public AdvancedRandom(float seed)

Parameters

seed float

A floating-point number, whose bit reinterpretation as an int will be used to calculate a starting value for the pseudo-random number sequence.

AdvancedRandom(ushort)

Initializes a new instance of the AdvancedRandom class, using the specified seed value.

public AdvancedRandom(ushort seed)

Parameters

seed ushort

A number used to calculate a starting value for the pseudo-random number sequence.

AdvancedRandom(uint)

Initializes a new instance of the AdvancedRandom class, using the specified seed value.

public AdvancedRandom(uint seed)

Parameters

seed uint

A number used to calculate a starting value for the pseudo-random number sequence. If a negative number is specified, the absolute value of the number is used.

AdvancedRandom(ulong)

Initializes a new instance of the AdvancedRandom class, using the specified seed value.

public AdvancedRandom(ulong seed)

Parameters

seed ulong

A number, whose hash code will be used to calculate a starting value for the pseudo-random number sequence.

Methods

ExtendSample(long)

protected virtual long ExtendSample(long result)

Parameters

result long

Returns

long

ExtendSample(ulong)

protected virtual ulong ExtendSample(ulong result)

Parameters

result ulong

Returns

ulong

NextBoolean()

Generates a random bool.

public virtual bool NextBoolean()

Returns

bool

The resulting bool.

NextByte()

Generates a random byte within the range [0, MaxValue].

public virtual byte NextByte()

Returns

byte

The resulting byte.

NextByte(byte)

Generates a random byte within the range [0, maxValue).

public virtual byte NextByte(byte maxValue)

Parameters

maxValue byte

The exclusive upper bound of the random number returned. Must be greater than 0.

Returns

byte

The resulting byte.

NextByte(byte, byte)

Generates a random byte within the range [minValue, maxValue).

public virtual byte NextByte(byte minValue, byte maxValue)

Parameters

minValue byte

The inclusive lower bound of the random number returned.

maxValue byte

The exclusive upper bound of the random number returned. Must be greater than minValue.

Returns

byte

The resulting byte.

NextChar()

Generates a random char within the range [0, MaxValue].

public virtual char NextChar()

Returns

char

The resulting char.

NextChar(char)

Generates a random char within the range [0, maxValue).

public virtual char NextChar(char maxValue)

Parameters

maxValue char

The exclusive upper bound of the random number returned. Must be greater than 0.

Returns

char

The resulting char.

NextChar(char, char)

Generates a random char within the range [minValue, maxValue).

public virtual char NextChar(char minValue, char maxValue)

Parameters

minValue char

The inclusive lower bound of the random number returned.

maxValue char

The exclusive upper bound of the random number returned. Must be greater than minValue.

Returns

char

The resulting char.

NextDouble(double)

Generates a random double within the range [0, maxValue).

public virtual double NextDouble(double maxValue)

Parameters

maxValue double

The exclusive upper bound of the random number returned. Must be greater than 0.

Returns

double

The resulting double.

NextDouble(double, double)

Generates a random double within the range [minValue, maxValue).

public virtual double NextDouble(double minValue, double maxValue)

Parameters

minValue double

The inclusive lower bound of the random number returned.

maxValue double

The exclusive upper bound of the random number returned. Must be greater than minValue.

Returns

double

The resulting double.

NextInt16()

Generates a random short within the range [0, MaxValue].

public virtual short NextInt16()

Returns

short

The resulting short.

NextInt16(short)

Generates a random short within the range [0, maxValue).

public virtual short NextInt16(short maxValue)

Parameters

maxValue short

The exclusive upper bound of the random number returned. Must be greater than 0.

Returns

short

The resulting short.

NextInt16(short, short)

Generates a random short within the range [minValue, maxValue).

public virtual short NextInt16(short minValue, short maxValue)

Parameters

minValue short

The inclusive lower bound of the random number returned.

maxValue short

The exclusive upper bound of the random number returned. Must be greater than minValue.

Returns

short

The resulting short.

NextSByte()

Generates a random sbyte within the range [0, MaxValue].

public virtual sbyte NextSByte()

Returns

sbyte

The resulting sbyte.

NextSByte(sbyte)

Generates a random sbyte within the range [0, maxValue).

public virtual sbyte NextSByte(sbyte maxValue)

Parameters

maxValue sbyte

The exclusive upper bound of the random number returned. Must be greater than 0.

Returns

sbyte

The resulting sbyte.

NextSByte(sbyte, sbyte)

Generates a random sbyte within the range [minValue, maxValue).

public virtual sbyte NextSByte(sbyte minValue, sbyte maxValue)

Parameters

minValue sbyte

The inclusive lower bound of the random number returned.

maxValue sbyte

The exclusive upper bound of the random number returned. Must be greater than minValue.

Returns

sbyte

The resulting sbyte.

NextSingle(float)

Generates a random float within the range [0, maxValue).

public virtual float NextSingle(float maxValue)

Parameters

maxValue float

The exclusive upper bound of the random number returned. Must be greater than 0.

Returns

float

The resulting float.

NextSingle(float, float)

Generates a random float within the range [minValue, maxValue).

public virtual float NextSingle(float minValue, float maxValue)

Parameters

minValue float

The inclusive lower bound of the random number returned.

maxValue float

The exclusive upper bound of the random number returned. Must be greater than minValue.

Returns

float

The resulting float.

NextUInt16()

Generates a random ushort within the range [0, MaxValue].

public virtual ushort NextUInt16()

Returns

ushort

The resulting ushort.

NextUInt16(ushort)

Generates a random ushort within the range [0, maxValue).

public virtual ushort NextUInt16(ushort maxValue)

Parameters

maxValue ushort

The exclusive upper bound of the random number returned. Must be greater than 0.

Returns

ushort

The resulting ushort.

NextUInt16(ushort, ushort)

Generates a random ushort within the range [minValue, maxValue).

public virtual ushort NextUInt16(ushort minValue, ushort maxValue)

Parameters

minValue ushort

The inclusive lower bound of the random number returned.

maxValue ushort

The exclusive upper bound of the random number returned. Must be greater than minValue.

Returns

ushort

The resulting ushort.

NextUInt32()

Generates a random uint within the range [0, MaxValue].

public virtual uint NextUInt32()

Returns

uint

The resulting uint.

NextUInt32(uint)

Generates a random uint within the range [0, maxValue).

public virtual uint NextUInt32(uint maxValue)

Parameters

maxValue uint

The exclusive upper bound of the random number returned. Must be greater than 0.

Returns

uint

The resulting uint.

NextUInt32(uint, uint)

Generates a random uint within the range [minValue, maxValue).

public virtual uint NextUInt32(uint minValue, uint maxValue)

Parameters

minValue uint

The inclusive lower bound of the random number returned.

maxValue uint

The exclusive upper bound of the random number returned. Must be greater than minValue.

Returns

uint

The resulting uint.

NextUInt64()

Generates a random ulong within the range [0, MaxValue]. May use up to 2 number generations due to double's lesser precision.

public virtual ulong NextUInt64()

Returns

ulong

The resulting ulong.

NextUInt64(ulong)

Generates a random ulong within the range [0, maxValue). May use up to 2 number generations due to double's lesser precision.

public virtual ulong NextUInt64(ulong maxValue)

Parameters

maxValue ulong

The exclusive upper bound of the random number returned. Must be greater than 0.

Returns

ulong

The resulting ulong.

NextUInt64(ulong, ulong)

Generates a random ulong within the range [minValue, maxValue). May use up to 2 number generations due to double's lesser precision.

public virtual ulong NextUInt64(ulong minValue, ulong maxValue)

Parameters

minValue ulong

The inclusive lower bound of the random number returned.

maxValue ulong

The exclusive upper bound of the random number returned. Must be greater than minValue.

Returns

ulong

The resulting ulong.

Sample(double)

protected virtual double Sample(double maxValue)

Parameters

maxValue double

Returns

double

Sample(double, double)

protected virtual double Sample(double minValue, double maxValue)

Parameters

minValue double
maxValue double

Returns

double