Random Number Generator.
More...
#include <rng.h>
|
|
using | Seed = unsigned int |
| | Typedef for seed values.
|
| |
Random Number Generator.
Uses C++11 RNG features for optimal quality RNG.
Constructor.
- Parameters
-
| seed | The seed used for initializing the RNG |
Generates a proper random seed.
- Returns
- Seed with high amount of entropy
| double RNG::getDouble |
( |
double |
min, |
|
|
double |
max |
|
) |
| |
Generates a random double between min and max.
- Returns
- Double in range [min, max]
| int RNG::getInt |
( |
int |
min, |
|
|
int |
max |
|
) |
| |
Generates a random integer between min and max.
- Returns
- int in range [min, max] inclusive
Returns the current seed.
- Returns
- The used seed
| luabind::scope RNG::luaBindings |
( |
| ) |
|
|
static |
| void RNG::setSeed |
( |
Seed |
seed | ) |
|
Restarts the RNG with provided seed.
- Parameters
-
| seed | The seed used for reinitializing the RNG |
template<typename iterType >
| void thrive::RNG::shuffle |
( |
iterType |
first, |
|
|
iterType |
last |
|
) |
| |
|
inline |
Shuffles iterable collection.
- Template Parameters
-
- Returns
- int in range [min, max] inclusive
The documentation for this class was generated from the following files:
- /home/hhyyrylainen/Projects/thrive_install/thrive/src/engine/rng.h
- /home/hhyyrylainen/Projects/thrive_install/thrive/src/engine/rng.cpp