Random.cppm 472 B

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