C# Class Rolcore.ThreadSafeRandom

Provides a thread-safe, statistically random operations. Use instead of Random.
Exibir arquivo Open project: Rollins/Rolcore

Public Methods

Method Description
Next ( ) : int

Returns a non-negative random number.

Next ( int maxValue ) : int

Returns a non-negative random number less than the specified maximum.

Next ( int minValue, int maxValue ) : int

Returns a random number within a specified range.

Private Methods

Method Description
EnsureLocal ( ) : void

Ensures a thread-local Random instance is available.

Method Details

Next() public static method

Returns a non-negative random number.
public static Next ( ) : int
return int

Next() public static method

Returns a non-negative random number less than the specified maximum.
public static Next ( int maxValue ) : int
maxValue int The exclusive upper bound of the random number to be generated. /// Must be greater than or equal to zero.
return int

Next() public static method

Returns a random number within a specified range.
public static Next ( int minValue, int maxValue ) : int
minValue int The inclusive lower bound of the random number returned.
maxValue int The exclusive upper bound of the random number to be generated. /// Must be greater than or equal to zero.
return int