TrinityCore
Random.h File Reference
#include "Define.h"
#include "Duration.h"
#include <limits>
+ Include dependency graph for Random.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  RandomEngine
 

Functions

TC_COMMON_API int32 irand (int32 min, int32 max)
 
TC_COMMON_API uint32 urand (uint32 min, uint32 max)
 
TC_COMMON_API uint32 urandms (uint32 min, uint32 max)
 
TC_COMMON_API uint32 rand32 ()
 
TC_COMMON_API Milliseconds randtime (Milliseconds min, Milliseconds max)
 
TC_COMMON_API float frand (float min, float max)
 
TC_COMMON_API float rand_norm ()
 
TC_COMMON_API float rand_chance ()
 
TC_COMMON_API uint32 urandweighted (size_t count, double const *chances)
 
bool roll_chance_f (float chance)
 
bool roll_chance_i (int chance)
 

Function Documentation

◆ frand()

TC_COMMON_API float frand ( float  min,
float  max 
)

Definition at line 55 of file Random.cpp.

+ Here is the caller graph for this function:

◆ irand()

TC_COMMON_API int32 irand ( int32  min,
int32  max 
)

Definition at line 35 of file Random.cpp.

+ Here is the caller graph for this function:

◆ rand32()

TC_COMMON_API uint32 rand32 ( )

Definition at line 70 of file Random.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ rand_chance()

TC_COMMON_API float rand_chance ( )

Definition at line 81 of file Random.cpp.

+ Here is the caller graph for this function:

◆ rand_norm()

TC_COMMON_API float rand_norm ( )

Definition at line 75 of file Random.cpp.

+ Here is the caller graph for this function:

◆ randtime()

TC_COMMON_API Milliseconds randtime ( Milliseconds  min,
Milliseconds  max 
)

Definition at line 62 of file Random.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ roll_chance_f()

bool roll_chance_f ( float  chance)
inline

Definition at line 53 of file Random.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ roll_chance_i()

bool roll_chance_i ( int  chance)
inline

Definition at line 59 of file Random.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ urand()

TC_COMMON_API uint32 urand ( uint32  min,
uint32  max 
)

Definition at line 42 of file Random.cpp.

◆ urandms()

TC_COMMON_API uint32 urandms ( uint32  min,
uint32  max 
)

Definition at line 49 of file Random.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ urandweighted()

TC_COMMON_API uint32 urandweighted ( size_t  count,
double const *  chances 
)

Definition at line 87 of file Random.cpp.

+ Here is the caller graph for this function: