diff options
author | Loek Le Blansch <loek@pipeframe.xyz> | 2024-10-29 21:30:38 +0100 |
---|---|---|
committer | Loek Le Blansch <loek@pipeframe.xyz> | 2024-10-29 21:30:38 +0100 |
commit | a04cb74fee079e3ee43ae5fae32fc2674409822c (patch) | |
tree | 403e681a768ee68b54569e93d98e741878cd7975 /backend/Dungeon.cpp | |
parent | 9283e1eb66d6ff96b02f317e28cb6ff060953cdf (diff) |
implement movement
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]; +} + |