Skip to content

Class Lidgren::Network::NetRandom

ClassList > Lidgren > Network > NetRandom

NetRandom base class.

Inherits the following classes: Random

Inherited by the following classes: Lidgren::Network::CryptoRandom, Lidgren::Network::MWCRandom, Lidgren::Network::MersenneTwisterRandom, Lidgren::Network::XorShiftRandom

Public Static Attributes

Type Name
NetRandom Instance = = new MWCRandom()
Get global instance of NetRandom (uses MWCRandom)

Public Functions

Type Name
virtual void Initialize (uint seed)
(Re)initialize this instance with provided 32 bit seed
NetRandom ()
Constructor with randomized seed.
NetRandom (int seed)
Constructor with provided 32 bit seed.
override int Next ()
Generates a random value that is greater or equal than 0 and less than Int32.MaxValue.
override int Next (int maxValue)
Returns a random value is greater or equal than 0 and less than maxValue.
override int Next (int minValue, int maxValue)
Returns a random value is greater or equal than minValue and less than maxValue.
bool NextBool ()
Returns true or false, randomly.
virtual void NextBytes (byte[] buffer, int offset, int length)
Fills all bytes from offset to offset + length in buffer with random values.
override void NextBytes (byte[] buffer)
Fill the specified buffer with random values.
override double NextDouble ()
Returns random value larger or equal to 0.0 and less than 1.0.
int NextInt32 ()
Generates a random value greater or equal than 0 and less or equal than Int32.MaxValue (inclusively)
float NextSingle ()
Returns random value is greater or equal than 0.0f and less than 1.0f.
virtual uint NextUInt32 ()
Generates a random value from UInt32.MinValue to UInt32.MaxValue, inclusively.
ulong NextUInt64 ()
Generates a random value between UInt64.MinValue to UInt64.MaxValue.

Protected Functions

Type Name
override double Sample ()
Returns random value is greater or equal than 0.0 and less than 1.0.

Public Static Attributes Documentation

variable Instance

NetRandom Lidgren.Network.NetRandom.Instance;

Public Functions Documentation

function Initialize

inline virtual void Lidgren::Network::NetRandom::Initialize (
    uint seed
) 

function NetRandom [1/2]

inline Lidgren::Network::NetRandom::NetRandom () 

function NetRandom [2/2]

inline Lidgren::Network::NetRandom::NetRandom (
    int seed
) 

function Next [1/3]

inline override int Lidgren::Network::NetRandom::Next () 

function Next [2/3]

inline override int Lidgren::Network::NetRandom::Next (
    int maxValue
) 

function Next [3/3]

inline override int Lidgren::Network::NetRandom::Next (
    int minValue,
    int maxValue
) 

function NextBool

inline bool Lidgren::Network::NetRandom::NextBool () 

function NextBytes [1/2]

inline virtual void Lidgren::Network::NetRandom::NextBytes (
    byte[] buffer,
    int offset,
    int length
) 

function NextBytes [2/2]

inline override void Lidgren::Network::NetRandom::NextBytes (
    byte[] buffer
) 

function NextDouble

inline override double Lidgren::Network::NetRandom::NextDouble () 

function NextInt32

inline int Lidgren::Network::NetRandom::NextInt32 () 

function NextSingle

inline float Lidgren::Network::NetRandom::NextSingle () 

function NextUInt32

inline virtual uint Lidgren::Network::NetRandom::NextUInt32 () 

function NextUInt64

inline ulong Lidgren::Network::NetRandom::NextUInt64 () 

Protected Functions Documentation

function Sample

inline override double Lidgren::Network::NetRandom::Sample () 

The documentation for this class was generated from the following file api/unity-plugin/Scripts/Networking/Lidgren.Network/NetRandom.cs