12345678910111213141516171819202122232425262728293031 |
- #ifndef CORE_RANDOM_HPP
- #define CORE_RANDOM_HPP
- #include "utils/Types.hpp"
- namespace Core {
- struct Random final {
- using Seed = u32;
- private:
- constexpr static int N = 25;
- constexpr static int M = 7;
- Seed data[N];
- int index;
- public:
- Random(Seed seed);
- int next();
- int next(int min, int inclusiveMax);
- bool nextBool();
- float nextFloat();
- float nextFloat(float min, float exclusiveMax);
- private:
- void update();
- };
- }
- #endif
|