Interface IRandom
An pseudorandom number generator interface equivalent to
Although these two types have similar shapes, they are not compatible (i.e., disallowed to be casted to each other).
Namespace: Libplanet.Action
Assembly: Libplanet.dll
Syntax
public interface IRandom
Methods
| Improve this Doc View SourceNext()
Gets a non-negative random integer.
Declaration
int Next()
Returns
Type | Description |
---|---|
Int32 | A 32-bit signed integer that is greater than or equal to
0 and less than |
Next(Int32)
Gets a non-negative random integer that is less than the specified
upperBound
.
Declaration
int Next(int upperBound)
Parameters
Type | Name | Description |
---|---|---|
Int32 | upperBound | The exclusive upper bound of the random number to be generated. It must be greater than or equal to 0. |
Returns
Type | Description |
---|---|
Int32 | A 32-bit signed integer that is greater than or equal to
0 and less than |
Next(Int32, Int32)
Gets a random integer that is within a specified range.
Declaration
int Next(int lowerBound, int upperBound)
Parameters
Type | Name | Description |
---|---|---|
Int32 | lowerBound | The inclusive lower bound of the random number to be generated. |
Int32 | upperBound | The exclusive upper bound of the random
number to be generated. It must be greater than or equal to
|
Returns
Type | Description |
---|---|
Int32 | A 32-bit signed integer that is greater than or equal to
|
NextBytes(Byte[])
Fills the elements of a specified buffer
with random numbers.
Declaration
void NextBytes(byte[] buffer)
Parameters
Type | Name | Description |
---|---|---|
Byte[] | buffer | A |