C# Class GameMath.Random2

Afficher le fichier Open project: npruehs/game-math

Méthodes publiques

Méthode Description
NextDouble ( ) : double

Gets the next random number in the sequence and returns it as a double-precision floating-point number between 0.0 and 1.0.

NextFloat ( ) : float

Gets the next random number in the sequence and returns it as a single-precision floating-point number between 0.0f and 1.0f.

NextInt ( ) : int

Gets the next random number in the sequence and returns it as a 32-bit signed integer.

NextInt ( int maxExclusive ) : int

Gets the next random number in the sequence and returns it as a 32-bit signed integer with the specified upper bound.

NextLong ( ) : long

Gets the next random number in the sequence and returns it as a 64-bit signed integer.

NextLong ( long maxExclusive ) : long

Gets the next random number in the sequence and returns it as a 64-bit signed integer with the specified upper bound.

Random2 ( ) : System

Constructs a new random number generator with the current system time as seed.

Random2 ( long seed ) : System

Constructs a new random number generator with the given 64-bit unsigned integer as seed.

Private Methods

Méthode Description
NextULong ( ) : ulong

Gets the next random number in the sequence and returns it as a 64-bit unsigned integer.

Method Details

NextDouble() public méthode

Gets the next random number in the sequence and returns it as a double-precision floating-point number between 0.0 and 1.0.
public NextDouble ( ) : double
Résultat double

NextFloat() public méthode

Gets the next random number in the sequence and returns it as a single-precision floating-point number between 0.0f and 1.0f.
public NextFloat ( ) : float
Résultat float

NextInt() public méthode

Gets the next random number in the sequence and returns it as a 32-bit signed integer.
public NextInt ( ) : int
Résultat int

NextInt() public méthode

Gets the next random number in the sequence and returns it as a 32-bit signed integer with the specified upper bound.
public NextInt ( int maxExclusive ) : int
maxExclusive int /// Exclusive upper bound on the number to get. ///
Résultat int

NextLong() public méthode

Gets the next random number in the sequence and returns it as a 64-bit signed integer.
public NextLong ( ) : long
Résultat long

NextLong() public méthode

Gets the next random number in the sequence and returns it as a 64-bit signed integer with the specified upper bound.
public NextLong ( long maxExclusive ) : long
maxExclusive long /// Exclusive upper bound on the number to get. ///
Résultat long

Random2() public méthode

Constructs a new random number generator with the current system time as seed.
public Random2 ( ) : System
Résultat System

Random2() public méthode

Constructs a new random number generator with the given 64-bit unsigned integer as seed.
/// is equal to . ///
public Random2 ( long seed ) : System
seed long /// 64-bit unsigned integer to use as seed. ///
Résultat System