Random Class Reference

A random number generator for int, float and double values. More...

#include <random.h>

List of all members.

Public Member Functions

 Random (irr::s32 seedTime)
 ~Random ()
 Destructor.
irr::s32 randint (void)
 Generates a psuedo-random integer between 0 and 32767.
irr::s32 randint (irr::s32 max)
irr::s32 randint (irr::s32 min, irr::s32 max)
irr::f32 randfloat (void)
 Generates a psuedo-random float between 0.0 and 0.999...
irr::f32 randfloat (irr::f32 max)
irr::f32 randfloat (irr::f32 min, irr::f32 max)
irr::f64 randdouble (void)
 Generates a psuedo-random double between 0.0 and 0.999...
irr::f64 randdouble (irr::f64 max)
irr::f64 randdouble (irr::f64 min, irr::f64 max)


Detailed Description

A random number generator for int, float and double values.

You can always define min and max values (a range) where random numbers are generated. You must call randinit() first, otherwise this class will generate predictable numbers (not random numbers).

Definition at line 12 of file random.h.


Constructor & Destructor Documentation

Random::Random irr::s32  seedTime  ) 
 

Constructor.

Parameters:
seedTime : A signed integer, used to prevent predictable number generation.


Member Function Documentation

irr::f64 Random::randdouble irr::f64  min,
irr::f64  max
 

Generates a psuedo-random double between min and max.

Parameters:
min : A double as minimum range border.
max : A double as maximum range border.

irr::f64 Random::randdouble irr::f64  max  ) 
 

Generates a psuedo-random double between 0.0 and max.

Parameters:
max : A double as maximum range border.

irr::f32 Random::randfloat irr::f32  min,
irr::f32  max
 

Generates a psuedo-random float between min and max.

Parameters:
min : A float as minimum range border.
max : A float as maximum range border.

irr::f32 Random::randfloat irr::f32  max  ) 
 

Generates a psuedo-random float between 0.0 and max.

Parameters:
max : A float as maximum range border.

irr::s32 Random::randint irr::s32  min,
irr::s32  max
 

Generates a psuedo-random integer between min and max.

Parameters:
min : A signed integer as minimum range border.
max : A signed integer as maximum range border.

irr::s32 Random::randint irr::s32  max  ) 
 

Generates a psuedo-random integer between 0 and max.

Parameters:
max : A signed integer as maximum range border.


The documentation for this class was generated from the following files:
Generated on Sun Dec 2 17:09:58 2007 for Swarm by  doxygen 1.4.6-NO