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

Detailed Description

Random values generator.

Each call to a method that generates a value performs a bIsInit == true check first. If this check fails a builtInInit() is called. This ensures that Random number generator is always initialized before the rand() call is made.

Internally this uses srand() and rand() functions from C Standard Library.

Definition at line 39 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 42 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 48 of file random.cpp.


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