diff options
Diffstat (limited to 'frontend/load_dungeon.cpp')
-rw-r--r-- | frontend/load_dungeon.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/frontend/load_dungeon.cpp b/frontend/load_dungeon.cpp index e94cbcb..b60a7b9 100644 --- a/frontend/load_dungeon.cpp +++ b/frontend/load_dungeon.cpp @@ -1,3 +1,4 @@ +#include <csignal> #include <memory> #include <filesystem> #include <pugixml.hpp> @@ -54,22 +55,22 @@ unique_ptr<Dungeon> load_dungeon(const string & filename) { temp_map[tag.attribute("id").as_uint()] = { .location = location, .edges = { - tag.attribute("noord").as_uint(0), - tag.attribute("oost").as_uint(0), - tag.attribute("zuid").as_uint(0), - tag.attribute("west").as_uint(0), + [Direction::NORTH] = tag.attribute("noord").as_uint(0), + [Direction::EAST] = tag.attribute("oost").as_uint(0), + [Direction::SOUTH] = tag.attribute("zuid").as_uint(0), + [Direction::WEST] = tag.attribute("west").as_uint(0), }, }; dungeon->add_location(location); } // connect edges after creating all locations - for (auto & [here, temp] : temp_map) { + for (auto & [_, temp] : temp_map) { for (Direction direction : DIRECTIONS) { - unsigned there = temp.edges[direction]; + unsigned id = temp.edges[direction]; if (temp.edges[direction] == 0) continue; - if (!temp_map.contains(there)) continue; - temp.location->set_exit(direction, temp_map[there].location); + if (!temp_map.contains(id)) continue; + temp.location->set_exit(direction, temp_map[id].location); } } |