From 9f25878acfe1c7281a96f83742349516510c5b6d Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Tue, 2 May 2023 10:07:25 -0400 Subject: Added areas to map --- game_data.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'game_data.h') diff --git a/game_data.h b/game_data.h index 761b233..91b48a5 100644 --- a/game_data.h +++ b/game_data.h @@ -57,6 +57,7 @@ struct Location { }; struct MapArea { + int id; std::string name; std::vector locations; int map_x; @@ -67,20 +68,27 @@ class GameData { public: GameData(); + const std::vector& GetMapAreas() const { return map_areas_; } + + const MapArea& GetMapArea(int id) const { return map_areas_.at(id); } + private: int AddOrGetRoom(std::string room); int AddOrGetDoor(std::string room, std::string door); int AddOrGetPanel(std::string room, std::string panel); + int AddOrGetArea(std::string area); std::vector rooms_; std::vector doors_; std::vector panels_; + std::vector map_areas_; std::map room_by_id_; std::map door_by_id_; std::map panel_by_id_; + std::map area_by_id_; }; -const GameData &GetGameData(); +const GameData& GetGameData(); #endif /* end of include guard: GAME_DATA_H_9C42AC51 */ -- cgit 1.4.1