Random Class Reference

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.
 
static unsigned short nextUShort (unsigned short max)
 Generates a new random unsigned short.
 

Detailed Description

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.

Definition at line 40 of file random.h.

Member Function Documentation

void Random::init ( int  seed)
static

Inits or re-inits the Random class with specified seed.

Definition at line 38 of file random.cpp.

unsigned short Random::nextUShort ( unsigned short  max)
static

Generates a new random unsigned short.

Parameters
maxMaximum 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.


The documentation for this class was generated from the following files: