Random.cppm 535 B

1234567891011121314151617181920212223
  1. export module Core.Random;
  2. import Core.Array;
  3. export namespace Core {
  4. class Random final {
  5. Array<u32, 25> data;
  6. size_t index;
  7. public:
  8. Random(u32 seed) noexcept;
  9. u32 nextU32() noexcept;
  10. u32 nextU32(u32 min, u32 exclusiveMax) noexcept;
  11. i32 nextI32(i32 min, i32 exclusiveMax) noexcept;
  12. size_t nextSize(size_t min, size_t exclusiveMax) noexcept;
  13. bool nextBool() noexcept;
  14. float nextFloat() noexcept;
  15. private:
  16. void update() noexcept;
  17. };
  18. }