Random.hpp 514 B

123456789101112131415161718192021222324252627
  1. #ifndef CORE_RANDOM_H
  2. #define CORE_RANDOM_H
  3. #include "core/Array.hpp"
  4. #include "core/Types.hpp"
  5. namespace Core {
  6. class Random final {
  7. Array<u32, 25> data;
  8. size_t index;
  9. public:
  10. Random(u32 seed);
  11. u32 nextU32();
  12. u32 nextU32(u32 min, u32 exclusiveMax);
  13. i32 nextI32(i32 min, i32 exclusiveMax);
  14. size_t nextSize(size_t min, size_t exclusiveMax);
  15. bool nextBool();
  16. float nextFloat();
  17. private:
  18. void update();
  19. };
  20. }
  21. #endif