add item spawner

This commit is contained in:
2025-12-01 10:38:44 -05:00
parent 49751ea09e
commit d6dff2a539
6 changed files with 221 additions and 79 deletions

17
rng.cpp Normal file
View File

@@ -0,0 +1,17 @@
//
// Created by Grant Horner on 12/1/25.
//
#include "rng.h"
float Rng::generate() {
return static_cast<float>(rng()) / static_cast<float>(std::mt19937::max());
}
float Rng::generate(const uint32_t max) {
return generate() * static_cast<float>(max);
}
float Rng::generate(const int min, const int max) {
return generate() * (static_cast<float>(max) - static_cast<float>(min)) + static_cast<float>(min);
}