Random.cppm 463 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);
  9. u32 nextU32();
  10. u32 nextU32(u32 min, u32 exclusiveMax);
  11. i32 nextI32(i32 min, i32 exclusiveMax);
  12. size_t nextSize(size_t min, size_t exclusiveMax);
  13. bool nextBool();
  14. float nextFloat();
  15. private:
  16. void update();
  17. };
  18. }