Interface IRandom
Abstract random generator operations.
Namespace: Nier.Commons
Assembly: cs.temp.dll.dll
Syntax
public interface IRandom
Methods
Next()
Returns a non-negative random integer.
Declaration
int Next()
Returns
Type | Description |
---|---|
System.Int32 | A 32-bit signed integer that is greater than or equal to 0 and less than System.Int32.MaxValue. |
Next(Int32)
Returns a non-negative random integer that is less than the specified maximum.
Declaration
int Next(int maxValue)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | maxValue | The exclusive upper bound of the random number to be generated. maxValue must be greater than or equal to 0. |
Returns
Type | Description |
---|---|
System.Int32 | A 32-bit signed integer that is greater than or equal to 0, and less than |
Exceptions
Type | Condition |
---|---|
System.ArgumentOutOfRangeException |
|
Next(Int32, Int32)
Returns a random integer that is within a specified range.
Declaration
int Next(int minValue, int maxValue)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | minValue | The inclusive lower bound of the random number returned. |
System.Int32 | maxValue | The exclusive upper bound of the random number returned. maxValue must be greater than or equal to minValue. |
Returns
Type | Description |
---|---|
System.Int32 | A 32-bit signed integer greater than or equal to |
Exceptions
Type | Condition |
---|---|
System.ArgumentOutOfRangeException |
|
NextBytes(Byte[])
Fills the elements of a specified array of bytes with random numbers.
Declaration
void NextBytes(byte[] buffer)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | buffer | An array of bytes to contain random numbers. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
NextDouble()
Returns a random floating-point number that is greater than or equal to 0.0, and less than 1.0.
Declaration
double NextDouble()
Returns
Type | Description |
---|---|
System.Double | A double-precision floating point number that is greater than or equal to 0.0, and less than 1.0. |