Random.hpp 512 B

1234567891011121314151617181920212223242526272829
  1. #ifndef CORE_RANDOM_HPP
  2. #define CORE_RANDOM_HPP
  3. #include "core/data/Array.hpp"
  4. #include "core/utils/Types.hpp"
  5. namespace Core {
  6. struct Random final {
  7. using Seed = u32;
  8. private:
  9. Array<Seed, 25> data;
  10. int index;
  11. public:
  12. Random(Seed seed);
  13. int next();
  14. int next(int min, int inclusiveMax);
  15. bool nextBool();
  16. float nextFloat();
  17. float nextFloat(float min, float exclusiveMax);
  18. private:
  19. void update();
  20. };
  21. }
  22. #endif