Barotrauma Client Doc
Barotrauma.MTRandom Class Reference

Mersenne Twister based random More...

Inheritance diagram for Barotrauma.MTRandom:

Public Member Functions

 MTRandom ()
 Constructor with randomized seed More...
 
 MTRandom (int seed)
 Constructor with provided 32 bit seed More...
 
override int Next ()
 Generates a random value that is greater or equal than 0 and less than Int32.MaxValue More...
 
override int Next (int minValue, int maxValue)
 
override void NextBytes (byte[] buffer)
 
override void NextBytes (Span< byte > buffer)
 
override int Next (int maxValue)
 Returns a random value is greater or equal than 0 and less than maxValue More...
 
int NextInt32 ()
 Generates a random value greater or equal than 0 and less or equal than Int32.MaxValue (inclusively) More...
 
override double NextDouble ()
 Returns random value larger or equal to 0.0 and less than 1.0 More...
 

Detailed Description

Mersenne Twister based random

Definition at line 8 of file MTRandom.cs.

Constructor & Destructor Documentation

◆ MTRandom() [1/2]

Barotrauma.MTRandom.MTRandom ( )

Constructor with randomized seed

Definition at line 31 of file MTRandom.cs.

◆ MTRandom() [2/2]

Barotrauma.MTRandom.MTRandom ( int  seed)

Constructor with provided 32 bit seed

Definition at line 39 of file MTRandom.cs.

Member Function Documentation

◆ Next() [1/3]

override int Barotrauma.MTRandom.Next ( )

Generates a random value that is greater or equal than 0 and less than Int32.MaxValue

Definition at line 79 of file MTRandom.cs.

◆ Next() [2/3]

override int Barotrauma.MTRandom.Next ( int  maxValue)

Returns a random value is greater or equal than 0 and less than maxValue

Definition at line 106 of file MTRandom.cs.

◆ Next() [3/3]

override int Barotrauma.MTRandom.Next ( int  minValue,
int  maxValue 
)

Definition at line 87 of file MTRandom.cs.

◆ NextBytes() [1/2]

override void Barotrauma.MTRandom.NextBytes ( byte[]  buffer)

Definition at line 93 of file MTRandom.cs.

◆ NextBytes() [2/2]

override void Barotrauma.MTRandom.NextBytes ( Span< byte >  buffer)

Definition at line 98 of file MTRandom.cs.

◆ NextDouble()

override double Barotrauma.MTRandom.NextDouble ( )

Returns random value larger or equal to 0.0 and less than 1.0

Definition at line 122 of file MTRandom.cs.

◆ NextInt32()

int Barotrauma.MTRandom.NextInt32 ( )

Generates a random value greater or equal than 0 and less or equal than Int32.MaxValue (inclusively)

Definition at line 114 of file MTRandom.cs.