src/gengine/Random.h
raw| 1 | #ifndef HEADER_RANDOM_H |
| 2 | #define HEADER_RANDOM_H |
| 3 | |
| 4 | /** |
| 5 | * Utils for random numbers. |
| 6 | */ |
| 7 | class Random { |
| 8 | private: |
| 9 | static const int ARRAY_SIZE = 255; |
| 10 | static unsigned char ms_randArray[ARRAY_SIZE]; |
| 11 | public: |
| 12 | static void init(); |
| 13 | |
| 14 | static int randomInt(int bound); |
| 15 | static double randomReal(double bound); |
| 16 | |
| 17 | static unsigned char aByte(unsigned int index); |
| 18 | }; |
| 19 | |
| 20 | #endif |