C# Class LeopotamGroup.Math.Rng

Rng generator, mersenne twister based.
Afficher le fichier Open project: Leopotam/LeopotamGroupLibraryUnity

Méthodes publiques

Méthode Description
GetFloat ( bool includeOne = true ) : float

Get float random number from range [0, 1) or [0, 1] for includeOne=true.

GetFloat ( float min, float max, bool includeMax = true ) : float

Get float random number from range [min, max) or [min, max] for includeMax=true.

GetFloatStatic ( bool includeOne = true ) : float

Get float random number from range [0, 1) or [0, 1] for includeOne=true from singleton rng.

GetFloatStatic ( float min, float max, bool includeMax = true ) : float

Get float random number from range [min, max) or [min, max] for includeMax=true from singleton rng.

GetInt32 ( int max ) : int

Get int32 random number from range [0, max).

GetInt32 ( int min, int max ) : int

Get int32 random number from range [min, max).

GetInt32Static ( int n ) : int

Get int32 random number from range [0, n) from singleton rng.

GetInt32Static ( int min, int max ) : int

Get int32 random number from range [min, max) from singleton rng.

Rng ( ) : UnityEngine

Default initialization.

Rng ( long seed ) : UnityEngine

Initialization with custom seed.

SetSeed ( long seed ) : void

Set new seed.

SetSeedStatic ( long seed ) : void

Set new seed for singleton rng.

Private Methods

Méthode Description
GetRandomUInt32 ( ) : ulong

Method Details

GetFloat() public méthode

Get float random number from range [0, 1) or [0, 1] for includeOne=true.
public GetFloat ( bool includeOne = true ) : float
includeOne bool Include 1 value for searching.
Résultat float

GetFloat() public méthode

Get float random number from range [min, max) or [min, max] for includeMax=true.
public GetFloat ( float min, float max, bool includeMax = true ) : float
min float Min value.
max float Max value.
includeMax bool Include max value for searching.
Résultat float

GetFloatStatic() public static méthode

Get float random number from range [0, 1) or [0, 1] for includeOne=true from singleton rng.
public static GetFloatStatic ( bool includeOne = true ) : float
includeOne bool Include 1 value for searching.
Résultat float

GetFloatStatic() public static méthode

Get float random number from range [min, max) or [min, max] for includeMax=true from singleton rng.
public static GetFloatStatic ( float min, float max, bool includeMax = true ) : float
min float Min value.
max float Max value.
includeMax bool Include max value for searching.
Résultat float

GetInt32() public méthode

Get int32 random number from range [0, max).
public GetInt32 ( int max ) : int
max int Max value (excluded).
Résultat int

GetInt32() public méthode

Get int32 random number from range [min, max).
public GetInt32 ( int min, int max ) : int
min int Min value.
max int Max value (excluded).
Résultat int

GetInt32Static() public static méthode

Get int32 random number from range [0, n) from singleton rng.
public static GetInt32Static ( int n ) : int
n int .
Résultat int

GetInt32Static() public static méthode

Get int32 random number from range [min, max) from singleton rng.
public static GetInt32Static ( int min, int max ) : int
min int Min value.
max int Max value (excluded).
Résultat int

Rng() public méthode

Default initialization.
public Rng ( ) : UnityEngine
Résultat UnityEngine

Rng() public méthode

Initialization with custom seed.
public Rng ( long seed ) : UnityEngine
seed long Seed.
Résultat UnityEngine

SetSeed() public méthode

Set new seed.
public SetSeed ( long seed ) : void
seed long Seed.
Résultat void

SetSeedStatic() public static méthode

Set new seed for singleton rng.
public static SetSeedStatic ( long seed ) : void
seed long Seed.
Résultat void