Random.h 412 B

123456789101112131415161718192021222324252627
  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. int next();
  15. int next(int min, int inclusiveMax);
  16. float nextFloat();
  17. float nextFloat(float min, float exclusiveMax);
  18. };
  19. #endif