Option to set specific random seed for random number generator

This commit is contained in:
elsid 2019-02-24 22:41:11 +03:00
parent f6da025f02
commit 33f6fb258d
No known key found for this signature in database
GPG key ID: B845CB9FEE18AB40
7 changed files with 30 additions and 5 deletions

View file

@ -18,7 +18,7 @@ public:
static std::mt19937 generator;
/// seed the RNG
static void init();
static void init(unsigned int seed = generateDefaultSeed());
/// return value in range [0.0f, 1.0f) <- note open upper range.
static float rollProbability();
@ -31,6 +31,9 @@ public:
/// return value in range [0, 99]
static int roll0to99() { return rollDice(100); }
/// returns default seed for RNG
static unsigned int generateDefaultSeed();
};
}