diff options
Diffstat (limited to 'backend/Dungeon.cpp')
-rw-r--r-- | backend/Dungeon.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/backend/Dungeon.cpp b/backend/Dungeon.cpp index 55dccec..3de2f11 100644 --- a/backend/Dungeon.cpp +++ b/backend/Dungeon.cpp @@ -1,4 +1,5 @@ #include "Dungeon.h" +#include "RNG.h" void Dungeon::update() { @@ -8,3 +9,10 @@ void Dungeon::add_location(Location * location) { this->locations.push_back(location); } +Location * Dungeon::get_start_location() { + size_t size = this->locations.size(); + if (size == 0) return nullptr; + size_t index = RNG::get().rand_int(size); + return this->locations[index]; +} + |