Random.h 714 B

12345678910111213141516171819202122232425262728
  1. #ifndef CORE_RANDOM_H
  2. #define CORE_RANDOM_H
  3. #include "core/Types.h"
  4. typedef struct {
  5. u32 data[25];
  6. size_t index;
  7. } CoreRandom;
  8. void coreInitRandom(CoreRandom* r, u32 seed);
  9. u32 coreRandomU32(CoreRandom* r, u32 min, u32 exclusiveMax);
  10. i32 coreRandomI32(CoreRandom* r, i32 min, i32 exclusiveMax);
  11. size_t coreRandomSize(CoreRandom* r, size_t min, size_t exclusiveMax);
  12. bool coreRandomBool(CoreRandom* r);
  13. float coreRandomFloat(CoreRandom* r);
  14. #ifdef IMPORT_CORE
  15. #define Random CoreRandom
  16. #define initRandom coreInitRandom
  17. #define randomU32 coreRandomU32
  18. #define randomI32 coreRandomI32
  19. #define randomSize coreRandomSize
  20. #define randomBool coreRandomBool
  21. #define randomFloat coreRandomFloat
  22. #endif
  23. #endif