diff options
Diffstat (limited to 'backend/RNG.cpp')
-rw-r--r-- | backend/RNG.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/backend/RNG.cpp b/backend/RNG.cpp index 2d7895b..d804f7b 100644 --- a/backend/RNG.cpp +++ b/backend/RNG.cpp @@ -18,6 +18,10 @@ int RNG::rand_int(const int lower, const int upper) { uniform_int_distribution<int> random_dist(lower, upper - 1); return random_dist(rng); } +int RNG::rand_int(const Range<int> range) { + uniform_int_distribution<int> random_dist(range.min, range.max); + return random_dist(rng); +} double RNG::rand_double() { return this->rand_double(0.f, 1.f); |