Random values generator. More...
#include <random.h>
Static Public Member Functions | |
static void | init (int seed) |
Inits or re-inits the Random class with specified seed. More... | |
static unsigned short | nextUShort (unsigned short max) |
Generates a new random unsigned short. More... | |
Random values generator.
Each call to a method that generates a value checks for a properly seeded generator. If this check fails a builtInInit() is called. This ensures that a Random number generator is always initialized. Internally this uses the random C++ Standard Library, using the Mersenne Twister algorithm.
|
static |
Inits or re-inits the Random class with specified seed.
Definition at line 38 of file random.cpp.
|
static |
Generates a new random unsigned short.
max | Maximum value for the generated number. This is exclusive, ie. generated value is in range 0 <= x < max |
Definition at line 43 of file random.cpp.