The TRManager is the manager for all modules. More...

Inheritance diagram for Crosstales.TrueRandom.TRManager:

Public Member Functions

void OnEnable ()
 
void Update ()
 
void OnDisable ()
 
void OnApplicationQuit ()
 
int CalculateFloat (int number=1)
 Calculates needed bits (from the quota) for generating random floats. More...
 
int CalculateInteger (int max, int number=1)
 Calculates needed bits (from the quota) for generating random integers. More...
 
int CalculateSequence (int min, int max)
 Calculates needed bits (from the quota) for generating a random sequence. More...
 
int CalculateString (int length, int number=1)
 Calculates needed bits (from the quota) for generating random strings. More...
 
int CalculateVector2 (int number=1)
 Calculates needed bits (from the quota) for generating random Vector2. More...
 
int CalculateVector3 (int number=1)
 Calculates needed bits (from the quota) for generating random Vector3. More...
 
int CalculateVector4 (int number=1)
 Calculates needed bits (from the quota) for generating random Vector4. More...
 
string GenerateInteger (int min, int max, int number=1, string id="")
 Generates random integers. More...
 
string GenerateFloat (float min, float max, int number=1, string id="")
 Generates random floats. More...
 
string GenerateSequence (int min, int max, int number=0, string id="")
 Generates random sequence. More...
 
string GenerateString (int length, int number=1, bool digits=true, bool upper=true, bool lower=true, bool unique=false, string id="")
 Generates random strings. More...
 
string GenerateVector2 (Vector2 min, Vector2 max, int number=1, string id="")
 Generates random Vector2. More...
 
string GenerateVector3 (Vector3 min, Vector3 max, int number=1, string id="")
 Generates random Vector3. More...
 
string GenerateVector4 (Vector4 min, Vector4 max, int number=1, string id="")
 Generates random Vector4. More...
 
void GetQuota ()
 Gets the remaining quota in bits from the server. More...
 
System.Collections.Generic.List< int > GenerateIntegerPRNG (int min, int max, int number=1, int seed=0)
 Generates random integers with the C#-standard Pseudo-Random-Number-Generator. More...
 
System.Collections.Generic.List< float > GenerateFloatPRNG (float min, float max, int number=1, int seed=0)
 Generates random floats with the C#-standard Pseudo-Random-Number-Generator. More...
 
System.Collections.Generic.List< int > GenerateSequencePRNG (int min, int max, int number=0, int seed=0)
 Generates a random sequence with the C#-standard Pseudo-Random-Number-Generator. More...
 
System.Collections.Generic.List< string > GenerateStringPRNG (int length, int number=1, bool digits=true, bool upper=true, bool lower=true, bool unique=false, int seed=0)
 Generates random strings with the C#-standard Pseudo-Random-Number-Generator. More...
 
System.Collections.Generic.List< Vector2 > GenerateVector2PRNG (Vector2 min, Vector2 max, int number=1, int seed=0)
 Generates random Vector2 with the C#-standard Pseudo-Random-Number-Generator. More...
 
System.Collections.Generic.List< Vector3 > GenerateVector3PRNG (Vector3 min, Vector3 max, int number=1, int seed=0)
 Generates random Vector3 with the C#-standard Pseudo-Random-Number-Generator. More...
 
System.Collections.Generic.List< Vector4 > GenerateVector4PRNG (Vector4 min, Vector4 max, int number=1, int seed=0)
 Generates random Vector4 with the C#-standard Pseudo-Random-Number-Generator. More...
 

Static Public Member Functions

static void ResetObject ()
 Resets this object. More...
 

Public Attributes

bool prng = false
 
bool dontDestroy = true
 
readonly System.Collections.Generic.Dictionary< string, System.Collections.Generic.List< int > > AllIntegerResults = new System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<int>>()
 
readonly System.Collections.Generic.Dictionary< string, System.Collections.Generic.List< float > > AllFloatResults = new System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<float>>()
 
readonly System.Collections.Generic.Dictionary< string, System.Collections.Generic.List< int > > AllSequenceResults = new System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<int>>()
 
readonly System.Collections.Generic.Dictionary< string, System.Collections.Generic.List< string > > AllStringResults = new System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>>()
 
readonly System.Collections.Generic.Dictionary< string, System.Collections.Generic.List< Vector2 > > AllVector2Results = new System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<Vector2>>()
 
readonly System.Collections.Generic.Dictionary< string, System.Collections.Generic.List< Vector3 > > AllVector3Results = new System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<Vector3>>()
 
readonly System.Collections.Generic.Dictionary< string, System.Collections.Generic.List< Vector4 > > AllVector4Results = new System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<Vector4>>()
 
OnGenerateCompleted OnGenerateCompleted
 
OnQuotaUpdated OnQuotaUpdated
 
OnError OnError
 

Properties

static TRManager Instance [get]
 Returns the singleton instance of this class. More...
 
bool PRNG [get, set]
 Enable or disable the C#-standard Pseudo-Random-Number-Generator-mode. More...
 
bool DontDestroy [get, set]
 Don't destroy gameobject during scene switches. More...
 
int CurrentQuota [get]
 Returns the remaining quota in bits from the last check. More...
 
System.Collections.Generic.List< int > CurrentIntegers [get]
 Returns the list of integers from the last generation. More...
 
System.Collections.Generic.List< float > CurrentFloats [get]
 Returns the list of floats from the last generation. More...
 
System.Collections.Generic.List< int > CurrentSequence [get]
 Returns the sequence from the last generation. More...
 
System.Collections.Generic.List< string > CurrentStrings [get]
 Returns the list of strings from the last generation. More...
 
System.Collections.Generic.List< Vector2 > CurrentVector2 [get]
 Returns the list of Vector2 from the last generation. More...
 
System.Collections.Generic.List< Vector3 > CurrentVector3 [get]
 Returns the list of Vector3 from the last generation. More...
 
System.Collections.Generic.List< Vector4 > CurrentVector4 [get]
 Returns the list of Vector4 from the last generation. More...
 
bool isGenerating [get]
 Checks if True Random is generating numbers on this system. More...
 
static int Seed [get]
 Returns a seed for the PRNG. More...
 

Events

GenerateIntegerStart OnGenerateIntegerStart
 An event triggered whenever generating integers has started. More...
 
GenerateIntegerFinished OnGenerateIntegerFinished
 An event triggered whenever generating integers has finished. More...
 
GenerateFloatStart OnGenerateFloatStart
 An event triggered whenever generating floats has started. More...
 
GenerateFloatFinished OnGenerateFloatFinished
 An event triggered whenever generating floats has finished. More...
 
GenerateSequenceStart OnGenerateSequenceStart
 An event triggered whenever generating sequence has started. More...
 
GenerateSequenceFinished OnGenerateSequenceFinished
 An event triggered whenever generating sequence has finished. More...
 
GenerateStringStart OnGenerateStringStart
 An event triggered whenever generating strings has started. More...
 
GenerateStringFinished OnGenerateStringFinished
 An event triggered whenever generating strings has finished. More...
 
GenerateVector2Start OnGenerateVector2Start
 An event triggered whenever generating Vector2 has started. More...
 
GenerateVector2Finished OnGenerateVector2Finished
 An event triggered whenever generating Vector2 has finished. More...
 
GenerateVector3Start OnGenerateVector3Start
 An event triggered whenever generating Vector3 has started. More...
 
GenerateVector3Finished OnGenerateVector3Finished
 An event triggered whenever generating Vector3 has finished. More...
 
GenerateVector4Start OnGenerateVector4Start
 An event triggered whenever generating Vector4 has started. More...
 
GenerateVector4Finished OnGenerateVector4Finished
 An event triggered whenever generating Vector4 has finished. More...
 
QuotaUpdate OnQuotaUpdate
 An event triggered whenever the quota is updated. More...
 
ErrorInfo OnErrorInfo
 An event triggered whenever an error occurs. More...
 

Detailed Description

The TRManager is the manager for all modules.

Member Function Documentation

◆ CalculateFloat()

int Crosstales.TrueRandom.TRManager.CalculateFloat ( int  number = 1)

Calculates needed bits (from the quota) for generating random floats.

Parameters
numberHow many numbers (default: 1, optional)
Returns
Needed bits for generating the floats.

◆ CalculateInteger()

int Crosstales.TrueRandom.TRManager.CalculateInteger ( int  max,
int  number = 1 
)

Calculates needed bits (from the quota) for generating random integers.

Parameters
maxBiggest allowed number
numberHow many numbers (default: 1, optional)
Returns
Needed bits for generating the integers.

◆ CalculateSequence()

int Crosstales.TrueRandom.TRManager.CalculateSequence ( int  min,
int  max 
)

Calculates needed bits (from the quota) for generating a random sequence.

Parameters
minStart of the interval
maxEnd of the interval
Returns
Needed bits for generating the sequence.

◆ CalculateString()

int Crosstales.TrueRandom.TRManager.CalculateString ( int  length,
int  number = 1 
)

Calculates needed bits (from the quota) for generating random strings.

Parameters
lengthLength of the strings
numberHow many strings (default: 1, optional)
Returns
Needed bits for generating the strings.

◆ CalculateVector2()

int Crosstales.TrueRandom.TRManager.CalculateVector2 ( int  number = 1)

Calculates needed bits (from the quota) for generating random Vector2.

Parameters
numberHow many Vector2 (default: 1, optional)
Returns
Needed bits for generating the Vector2.

◆ CalculateVector3()

int Crosstales.TrueRandom.TRManager.CalculateVector3 ( int  number = 1)

Calculates needed bits (from the quota) for generating random Vector3.

Parameters
numberHow many Vector3 (default: 1, optional)
Returns
Needed bits for generating the Vector3.

◆ CalculateVector4()

int Crosstales.TrueRandom.TRManager.CalculateVector4 ( int  number = 1)

Calculates needed bits (from the quota) for generating random Vector4.

Parameters
numberHow many Vector4 (default: 1, optional)
Returns
Needed bits for generating the Vector4.

◆ GenerateFloat()

string Crosstales.TrueRandom.TRManager.GenerateFloat ( float  min,
float  max,
int  number = 1,
string  id = "" 
)

Generates random floats.

Parameters
minSmallest possible number (range: -1'000'000'000 - 1'000'000'000)
maxBiggest possible number (range: -1'000'000'000 - 1'000'000'000)
numberHow many numbers you want to generate (range: 1 - 10'000, default: 1, optional)
idUID to identify the generated result (optional)
Returns
UID of the generator.

◆ GenerateFloatPRNG()

System.Collections.Generic.List<float> Crosstales.TrueRandom.TRManager.GenerateFloatPRNG ( float  min,
float  max,
int  number = 1,
int  seed = 0 
)

Generates random floats with the C#-standard Pseudo-Random-Number-Generator.

Parameters
minSmallest possible number
maxBiggest possible number
numberHow many numbers you want to generate (default: 1, optional)
seedSeed for the PRNG (default: 0 (=standard), optional)
Returns
List with the generated floats.

◆ GenerateInteger()

string Crosstales.TrueRandom.TRManager.GenerateInteger ( int  min,
int  max,
int  number = 1,
string  id = "" 
)

Generates random integers.

Parameters
minSmallest possible number (range: -1'000'000'000 - 1'000'000'000)
maxBiggest possible number (range: -1'000'000'000 - 1'000'000'000)
numberHow many numbers you want to generate (range: 1 - 10'000, default: 1, optional)
idUID to identify the generated result (optional)
Returns
UID of the generator.

◆ GenerateIntegerPRNG()

System.Collections.Generic.List<int> Crosstales.TrueRandom.TRManager.GenerateIntegerPRNG ( int  min,
int  max,
int  number = 1,
int  seed = 0 
)

Generates random integers with the C#-standard Pseudo-Random-Number-Generator.

Parameters
minSmallest possible number
maxBiggest possible number
numberHow many numbers you want to generate (default: 1, optional)
seedSeed for the PRNG (default: 0 (=standard), optional)
Returns
List with the generated integers.

◆ GenerateSequence()

string Crosstales.TrueRandom.TRManager.GenerateSequence ( int  min,
int  max,
int  number = 0,
string  id = "" 
)

Generates random sequence.

Parameters
minStart of the interval (range: -1'000'000'000 - 1'000'000'000)
maxEnd of the interval (range: -1'000'000'000 - 1'000'000'000)
numberHow many numbers you have in the result (max range: max - min, optional)
idUID to identify the generated result (optional)
Returns
UID of the generator.

◆ GenerateSequencePRNG()

System.Collections.Generic.List<int> Crosstales.TrueRandom.TRManager.GenerateSequencePRNG ( int  min,
int  max,
int  number = 0,
int  seed = 0 
)

Generates a random sequence with the C#-standard Pseudo-Random-Number-Generator.

Parameters
minStart of the interval
maxEnd of the interval
numberHow many numbers you have in the result (max range: max - min, optional)
seedSeed for the PRNG (default: 0 (=standard), optional)
Returns
List with the generated sequence.

◆ GenerateString()

string Crosstales.TrueRandom.TRManager.GenerateString ( int  length,
int  number = 1,
bool  digits = true,
bool  upper = true,
bool  lower = true,
bool  unique = false,
string  id = "" 
)

Generates random strings.

Parameters
lengthHow long the strings should be (range: 1 - 20)
numberHow many strings you want to generate (range: 1 - 10'000, default: 1, optional)
digitsAllow digits (0-9) (default: true, optional)
upperAllow uppercase (A-Z) letters (default: true, optional)
lowerAllow lowercase (a-z) letters (default: true, optional)
uniqueString should be unique in the result (default: false, optional)
idUID to identify the generated result (optional)
Returns
UID of the generator.

◆ GenerateStringPRNG()

System.Collections.Generic.List<string> Crosstales.TrueRandom.TRManager.GenerateStringPRNG ( int  length,
int  number = 1,
bool  digits = true,
bool  upper = true,
bool  lower = true,
bool  unique = false,
int  seed = 0 
)

Generates random strings with the C#-standard Pseudo-Random-Number-Generator.

Parameters
lengthHow long the strings should be
numberHow many strings you want to generate (default: 1, optional)
digitsAllow digits (0-9) (default: true, optional)
upperAllow uppercase (A-Z) letters (default: true, optional)
lowerAllow lowercase (a-z) letters (default: true, optional)
uniqueString should be unique (default: false, optional)
seedSeed for the PRNG (default: 0 (=standard), optional)
Returns
List with the generated strings.

◆ GenerateVector2()

string Crosstales.TrueRandom.TRManager.GenerateVector2 ( Vector2  min,
Vector2  max,
int  number = 1,
string  id = "" 
)

Generates random Vector2.

Parameters
minSmallest possible Vector2 (range: -1'000'000'000 - 1'000'000'000)
maxBiggest possible Vector2 (range: -1'000'000'000 - 1'000'000'000)
numberHow many Vector2 you want to generate (range: 1 - 10'000, default: 1, optional)
idUID to identify the generated result (optional)
Returns
UID of the generator.

◆ GenerateVector2PRNG()

System.Collections.Generic.List<Vector2> Crosstales.TrueRandom.TRManager.GenerateVector2PRNG ( Vector2  min,
Vector2  max,
int  number = 1,
int  seed = 0 
)

Generates random Vector2 with the C#-standard Pseudo-Random-Number-Generator.

Parameters
minSmallest possible Vector2
maxBiggest possible Vector2
numberHow many Vector2 you want to generate (default: 1, optional)
seedSeed for the PRNG (default: 0 (=standard), optional)
Returns
List with the generated Vector2.

◆ GenerateVector3()

string Crosstales.TrueRandom.TRManager.GenerateVector3 ( Vector3  min,
Vector3  max,
int  number = 1,
string  id = "" 
)

Generates random Vector3.

Parameters
minSmallest possible Vector3 (range: -1'000'000'000 - 1'000'000'000)
maxBiggest possible Vector3 (range: -1'000'000'000 - 1'000'000'000)
numberHow many Vector3 you want to generate (range: 1 - 10'000, default: 1, optional)
idUID to identify the generated result (optional)
Returns
UID of the generator.

◆ GenerateVector3PRNG()

System.Collections.Generic.List<Vector3> Crosstales.TrueRandom.TRManager.GenerateVector3PRNG ( Vector3  min,
Vector3  max,
int  number = 1,
int  seed = 0 
)

Generates random Vector3 with the C#-standard Pseudo-Random-Number-Generator.

Parameters
minSmallest possible Vector3
maxBiggest possible Vector3
numberHow many Vector3 you want to generate (default: 1, optional)
seedSeed for the PRNG (default: 0 (=standard), optional)
Returns
List with the generated Vector3.

◆ GenerateVector4()

string Crosstales.TrueRandom.TRManager.GenerateVector4 ( Vector4  min,
Vector4  max,
int  number = 1,
string  id = "" 
)

Generates random Vector4.

Parameters
minSmallest possible Vector4 (range: -1'000'000'000 - 1'000'000'000)
maxBiggest possible Vector4 (range: -1'000'000'000 - 1'000'000'000)
numberHow many Vector4 you want to generate (range: 1 - 10'000, default: 1, optional)
idUID to identify the generated result (optional)
Returns
UID of the generator.

◆ GenerateVector4PRNG()

System.Collections.Generic.List<Vector4> Crosstales.TrueRandom.TRManager.GenerateVector4PRNG ( Vector4  min,
Vector4  max,
int  number = 1,
int  seed = 0 
)

Generates random Vector4 with the C#-standard Pseudo-Random-Number-Generator.

Parameters
minSmallest possible Vector4
maxBiggest possible Vector4
numberHow many Vector4 you want to generate (default: 1, optional)
seedSeed for the PRNG (default: 0 (=standard), optional)
Returns
List with the generated Vector4.

◆ GetQuota()

void Crosstales.TrueRandom.TRManager.GetQuota ( )

Gets the remaining quota in bits from the server.

◆ ResetObject()

static void Crosstales.TrueRandom.TRManager.ResetObject ( )
static

Resets this object.

Property Documentation

◆ CurrentFloats

System.Collections.Generic.List<float> Crosstales.TrueRandom.TRManager.CurrentFloats
get

Returns the list of floats from the last generation.

Returns
List of floats from the last generation.

◆ CurrentIntegers

System.Collections.Generic.List<int> Crosstales.TrueRandom.TRManager.CurrentIntegers
get

Returns the list of integers from the last generation.

Returns
List of integers from the last generation.

◆ CurrentQuota

int Crosstales.TrueRandom.TRManager.CurrentQuota
get

Returns the remaining quota in bits from the last check.

Returns
Remaining quota in bits from the last check.

◆ CurrentSequence

System.Collections.Generic.List<int> Crosstales.TrueRandom.TRManager.CurrentSequence
get

Returns the sequence from the last generation.

Returns
Sequence from the last generation.

◆ CurrentStrings

System.Collections.Generic.List<string> Crosstales.TrueRandom.TRManager.CurrentStrings
get

Returns the list of strings from the last generation.

Returns
List of strings from the last generation.

◆ CurrentVector2

System.Collections.Generic.List<Vector2> Crosstales.TrueRandom.TRManager.CurrentVector2
get

Returns the list of Vector2 from the last generation.

Returns
List of Vector2 from the last generation.

◆ CurrentVector3

System.Collections.Generic.List<Vector3> Crosstales.TrueRandom.TRManager.CurrentVector3
get

Returns the list of Vector3 from the last generation.

Returns
List of Vector3 from the last generation.

◆ CurrentVector4

System.Collections.Generic.List<Vector4> Crosstales.TrueRandom.TRManager.CurrentVector4
get

Returns the list of Vector4 from the last generation.

Returns
List of Vector4 from the last generation.

◆ DontDestroy

bool Crosstales.TrueRandom.TRManager.DontDestroy
getset

Don't destroy gameobject during scene switches.

◆ Instance

TRManager Crosstales.TrueRandom.TRManager.Instance
staticget

Returns the singleton instance of this class.

Returns
Singleton instance of this class.

◆ isGenerating

bool Crosstales.TrueRandom.TRManager.isGenerating
get

Checks if True Random is generating numbers on this system.

Returns
True if True Random is generating numbers on this system.

◆ PRNG

bool Crosstales.TrueRandom.TRManager.PRNG
getset

Enable or disable the C#-standard Pseudo-Random-Number-Generator-mode.

◆ Seed

int Crosstales.TrueRandom.TRManager.Seed
staticget

Returns a seed for the PRNG.

Returns
Seed for the PRNG.

Event Documentation

◆ OnErrorInfo

ErrorInfo Crosstales.TrueRandom.TRManager.OnErrorInfo

An event triggered whenever an error occurs.

◆ OnGenerateFloatFinished

GenerateFloatFinished Crosstales.TrueRandom.TRManager.OnGenerateFloatFinished

An event triggered whenever generating floats has finished.

◆ OnGenerateFloatStart

GenerateFloatStart Crosstales.TrueRandom.TRManager.OnGenerateFloatStart

An event triggered whenever generating floats has started.

◆ OnGenerateIntegerFinished

GenerateIntegerFinished Crosstales.TrueRandom.TRManager.OnGenerateIntegerFinished

An event triggered whenever generating integers has finished.

◆ OnGenerateIntegerStart

GenerateIntegerStart Crosstales.TrueRandom.TRManager.OnGenerateIntegerStart

An event triggered whenever generating integers has started.

◆ OnGenerateSequenceFinished

GenerateSequenceFinished Crosstales.TrueRandom.TRManager.OnGenerateSequenceFinished

An event triggered whenever generating sequence has finished.

◆ OnGenerateSequenceStart

GenerateSequenceStart Crosstales.TrueRandom.TRManager.OnGenerateSequenceStart

An event triggered whenever generating sequence has started.

◆ OnGenerateStringFinished

GenerateStringFinished Crosstales.TrueRandom.TRManager.OnGenerateStringFinished

An event triggered whenever generating strings has finished.

◆ OnGenerateStringStart

GenerateStringStart Crosstales.TrueRandom.TRManager.OnGenerateStringStart

An event triggered whenever generating strings has started.

◆ OnGenerateVector2Finished

GenerateVector2Finished Crosstales.TrueRandom.TRManager.OnGenerateVector2Finished

An event triggered whenever generating Vector2 has finished.

◆ OnGenerateVector2Start

GenerateVector2Start Crosstales.TrueRandom.TRManager.OnGenerateVector2Start

An event triggered whenever generating Vector2 has started.

◆ OnGenerateVector3Finished

GenerateVector3Finished Crosstales.TrueRandom.TRManager.OnGenerateVector3Finished

An event triggered whenever generating Vector3 has finished.

◆ OnGenerateVector3Start

GenerateVector3Start Crosstales.TrueRandom.TRManager.OnGenerateVector3Start

An event triggered whenever generating Vector3 has started.

◆ OnGenerateVector4Finished

GenerateVector4Finished Crosstales.TrueRandom.TRManager.OnGenerateVector4Finished

An event triggered whenever generating Vector4 has finished.

◆ OnGenerateVector4Start

GenerateVector4Start Crosstales.TrueRandom.TRManager.OnGenerateVector4Start

An event triggered whenever generating Vector4 has started.

◆ OnQuotaUpdate

QuotaUpdate Crosstales.TrueRandom.TRManager.OnQuotaUpdate

An event triggered whenever the quota is updated.


The documentation for this class was generated from the following file:
  • D:/slaubenberger/git/assets/TrueRandom/TrueRandomPro/Assets/Plugins/crosstales/TrueRandom/Scripts/TRManager.cs