C# 클래스 GameMath.Random2

파일 보기 프로젝트 열기: npruehs/game-math

공개 메소드들

메소드 설명
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.

비공개 메소드들

메소드 설명
NextULong ( ) : ulong

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

메소드 상세

NextDouble() 공개 메소드

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
리턴 double

NextFloat() 공개 메소드

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
리턴 float

NextInt() 공개 메소드

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

NextInt() 공개 메소드

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. ///
리턴 int

NextLong() 공개 메소드

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

NextLong() 공개 메소드

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. ///
리턴 long

Random2() 공개 메소드

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

Random2() 공개 메소드

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. ///
리턴 System