aboutsummaryrefslogtreecommitdiff
path: root/backend/RNG.cpp
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2024-11-01 21:33:27 +0100
committerLoek Le Blansch <loek@pipeframe.xyz>2024-11-01 21:33:27 +0100
commitaf76b9a0ae58dc8c87548053a5bc310ad6be25ce (patch)
treeb2aa5927ed19855c101120593b59a9c3224804ad /backend/RNG.cpp
parentbdf6ac149ec260dab767663419731b302679f458 (diff)
more small tweaks
Diffstat (limited to 'backend/RNG.cpp')
-rw-r--r--backend/RNG.cpp4
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);