tModLoader v2023.01
A mod to make and play Terraria mods
Terraria.Utilities.UnifiedRandom Class Reference

Public Member Functions

 UnifiedRandom (int Seed)
 
virtual int Next ()
 
virtual int Next (int maxValue)
 Generates a random value between 0 (inclusive) and maxValue (exclusive).
For example Next(4) can return one of 4 values: 0, 1, 2, or 3. It will not return 4. More...
 
virtual int Next (int minValue, int maxValue)
 Generates a random value between minValue (inclusive) and maxValue (exclusive).
For example Next(4, 8) can return 4, 5, 6, or 7. It will not return 8. More...
 
virtual void NextBytes (byte[] buffer)
 
virtual double NextDouble ()
 

Protected Member Functions

virtual double Sample ()
 

Member Function Documentation

◆ Next() [1/2]

virtual int Terraria.Utilities.UnifiedRandom.Next ( int  maxValue)
virtual

Generates a random value between 0 (inclusive) and maxValue (exclusive).
For example Next(4) can return one of 4 values: 0, 1, 2, or 3. It will not return 4.

Parameters
maxValue
Returns
Exceptions
ArgumentOutOfRangeException

◆ Next() [2/2]

virtual int Terraria.Utilities.UnifiedRandom.Next ( int  minValue,
int  maxValue 
)
virtual

Generates a random value between minValue (inclusive) and maxValue (exclusive).
For example Next(4, 8) can return 4, 5, 6, or 7. It will not return 8.

Parameters
minValue
maxValue
Returns
Exceptions
ArgumentOutOfRangeException