|
NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
|
#include <game/cLib/c_random.hpp>
Random number generation helper class.
Definition at line 6 of file c_random.hpp.
Public Member Functions | |
| cRandom_c (u32 seed) | |
| Initializes the class with the given seed. | |
| u32 | getRandomByAsm (ulong max) |
| Generates an integer between 0 and the given max. | |
| float | getRandomFByAsm () |
| Generates a floating point number between 0 and 1. | |
| float | getRandomF2ByAsm () |
| Generates a floating point number between -0.5 and 0.5. | |
Public Attributes | |
| u32 | mSeed |
| The current seed. | |
Private Member Functions | |
| u32 | ranqdStep () |
Implementation of the ranqd1 algorithm. | |
|
inline |
Initializes the class with the given seed.
Definition at line 10 of file c_random.hpp.
| u32 cRandom_c::getRandomByAsm | ( | ulong | max | ) |
Generates an integer between 0 and the given max.
Definition at line 32 of file c_random.cpp.
| float cRandom_c::getRandomFByAsm | ( | ) |
Generates a floating point number between 0 and 1.
Definition at line 37 of file c_random.cpp.
| float cRandom_c::getRandomF2ByAsm | ( | ) |
Generates a floating point number between -0.5 and 0.5.
Definition at line 43 of file c_random.cpp.
|
inlineprivate |
Implementation of the ranqd1 algorithm.
Definition at line 13 of file c_random.cpp.
| u32 cRandom_c::mSeed |
The current seed.
Definition at line 16 of file c_random.hpp.