Anvil
Anvil.API.RandomExtensions Class Reference

Extensions to the Random class for reimplementing native random functions (Dice and Ranges). More...

Static Public Member Functions

static double NextDouble (this Random random, double minValue, double maxValue)
 Returns a random double in the specified range. More...
 
static float NextFloat (this Random random)
 Returns a random floating-point number that is greater than or equal to 0.0f, and less than 1.0f. More...
 
static float NextFloat (this Random random, float minValue, float maxValue)
 Returns a random float in the specified range. More...
 

Detailed Description

Extensions to the Random class for reimplementing native random functions (Dice and Ranges).

Member Function Documentation

◆ NextDouble()

static double Anvil.API.RandomExtensions.NextDouble ( this Random  random,
double  minValue,
double  maxValue 
)
inlinestatic

Returns a random double in the specified range.

Parameters
randomThe random instance.
minValueThe minimum value (inclusive).
maxValueThe maximum value (exclusive).
Returns
A random double in the specified range.

◆ NextFloat() [1/2]

static float Anvil.API.RandomExtensions.NextFloat ( this Random  random)
inlinestatic

Returns a random floating-point number that is greater than or equal to 0.0f, and less than 1.0f.

Parameters
randomThe random instance.
Returns
A random floating-point number that is greater than or equal to 0.0f, and less than 1.0f.

◆ NextFloat() [2/2]

static float Anvil.API.RandomExtensions.NextFloat ( this Random  random,
float  minValue,
float  maxValue 
)
inlinestatic

Returns a random float in the specified range.

Parameters
randomThe random instance.
minValueThe minimum value (inclusive).
maxValueThe maximum value (exclusive).
Returns
A random float in the specified range.

The documentation for this class was generated from the following file: