Random.cppm 491 B

1234567891011121314151617181920212223242526
  1. module;
  2. export module Core.Random;
  3. import Core.Array;
  4. import Core.Types;
  5. export 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. }