zenilib: Zeni::Random Class Reference

zenilib 0.5.3.0

- Main Page
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Member Functions | List of all members
Zeni::Random Class Reference
Zenilib

A Random Number Generator. More...

`#include <Random.h>`

## Public Member Functions

| Random (const Uint32 &seed=Uint32(std::rand()))
float | frand_lt ()
| Get a random floating point number in the range [0.0f, 1.0f) More...
float | frand_lte ()
| Get a random floating point number in the range [0.0f, 1.0f]. More...
Sint32 | rand ()
| Get a random integer in the range [0, rand_max()]. More...
Sint32 | rand_lt (const Sint32 &mod)
| Get a random integer in the range [0, mod) More...
Sint32 | rand_lte (const Sint32 &mod)
| Get a random integer in the range [0, mod]. More...
Sint32 | rand_max () const
| Get the maximum size of a random integer returned from rand() More...

## Detailed Description

A Random Number Generator.

Author
  bazald

Contact: bazal.nosp@m.d@ze.nosp@m.nipex.nosp@m..com

Definition at line 40 of file Random.h.

## Constructor & Destructor Documentation

Zeni::Random::Random | ( | const Uint32 & | seed = `Uint32(std::rand())` | ) |

inline

Definition at line 42 of file Random.h.

## Member Function Documentation

float Zeni::Random::frand_lt | ( |  | ) |

inline

Get a random floating point number in the range [0.0f, 1.0f)

Definition at line 59 of file Random.h.

float Zeni::Random::frand_lte | ( |  | ) |

inline

Get a random floating point number in the range [0.0f, 1.0f].

Definition at line 64 of file Random.h.

Referenced by Zeni::Game::run().

Sint32 Zeni::Random::rand | ( |  | ) |

inline

Get a random integer in the range [0, rand_max()].

Definition at line 53 of file Random.h.

Sint32 Zeni::Random::rand_lt | ( | const Sint32 & | mod | ) |

inline

Get a random integer in the range [0, mod)

Definition at line 69 of file Random.h.

References assert.

Referenced by Zeni::Game::run().

Sint32 Zeni::Random::rand_lte | ( | const Sint32 & | mod | ) |

inline

Get a random integer in the range [0, mod].

Definition at line 75 of file Random.h.

References assert.

Sint32 Zeni::Random::rand_max | ( |  | ) | const

inline

Get the maximum size of a random integer returned from rand()

Definition at line 48 of file Random.h.

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

- zenilib/jni/external/zenilib/zeni/Zeni/Random.h