diff options
author | Shauren <shauren.trinity@gmail.com> | 2019-11-09 13:32:58 +0100 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2021-12-19 00:13:11 +0100 |
commit | b93bf95f2e76eca8be12ba07828387ab8529c050 (patch) | |
tree | 3cce522959f5a57ed2c57aca2d0b339ad79bce4e /src/common/Utilities/Random.h | |
parent | 08b40733a58da23ced34915cb67c0ef24e6e9059 (diff) |
Core/Random: Refactor random number generation to use std::uniform_*_distribution to restrict result range instead of doing that ourselves
* Seed SFMTRand with more values for its state
(cherry picked from commit 73bc3d8ea49a4793b14976e86010a36f19c1d18b)
Diffstat (limited to 'src/common/Utilities/Random.h')
-rw-r--r-- | src/common/Utilities/Random.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/common/Utilities/Random.h b/src/common/Utilities/Random.h index 2f6d105fad1..82a498e42eb 100644 --- a/src/common/Utilities/Random.h +++ b/src/common/Utilities/Random.h @@ -62,9 +62,9 @@ inline bool roll_chance_i(int chance) } /* -* SFMT wrapper satisfying UniformRandomNumberGenerator concept for use in <random> algorithms +* Wrapper satisfying UniformRandomNumberGenerator concept for use in <random> algorithms */ -class TC_COMMON_API SFMTEngine +class TC_COMMON_API RandomEngine { public: typedef uint32 result_type; @@ -73,7 +73,7 @@ public: static constexpr result_type max() { return std::numeric_limits<result_type>::max(); } result_type operator()() const { return rand32(); } - static SFMTEngine& Instance(); + static RandomEngine& Instance(); }; #endif // Random_h__ |