Random.h 426 B

12345678910111213141516171819202122232425262728
  1. #ifndef RANDOM_H
  2. #define RANDOM_H
  3. #include "utils/Types.h"
  4. struct Random final {
  5. typedef uint32 Seed;
  6. private:
  7. constexpr static int N = 25;
  8. constexpr static int M = 7;
  9. Seed data[N];
  10. int index;
  11. void update();
  12. public:
  13. Random(Seed seed);
  14. Random();
  15. int next();
  16. int next(int min, int inclusiveMax);
  17. float nextFloat();
  18. float nextFloat(float min, float exclusiveMax);
  19. };
  20. #endif