From 73bc3d8ea49a4793b14976e86010a36f19c1d18b Mon Sep 17 00:00:00 2001 From: Shauren Date: Sat, 9 Nov 2019 13:32:58 +0100 Subject: 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 --- src/common/Utilities/Random.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/common/Utilities/Random.h') diff --git a/src/common/Utilities/Random.h b/src/common/Utilities/Random.h index bc1bf26e890..45d7457eb02 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 algorithms +* Wrapper satisfying UniformRandomNumberGenerator concept for use in 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::max(); } result_type operator()() const { return rand32(); } - static SFMTEngine& Instance(); + static RandomEngine& Instance(); }; #endif // Random_h__ -- cgit v1.2.3