aboutsummaryrefslogtreecommitdiff
path: root/src/common/Utilities/Random.h
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2019-11-09 13:32:58 +0100
committerShauren <shauren.trinity@gmail.com>2019-11-09 15:09:22 +0100
commit73bc3d8ea49a4793b14976e86010a36f19c1d18b (patch)
tree4d24a1bbbc757175633eaab2d65012570efa6a67 /src/common/Utilities/Random.h
parent4e0279b0e48c9992842010b9f3f132e54a460128 (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
Diffstat (limited to 'src/common/Utilities/Random.h')
-rw-r--r--src/common/Utilities/Random.h6
1 files changed, 3 insertions, 3 deletions
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 <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__