diff options
Diffstat (limited to 'game_data.h')
-rw-r--r-- | game_data.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/game_data.h b/game_data.h index 6ee277b..981f56f 100644 --- a/game_data.h +++ b/game_data.h | |||
@@ -45,11 +45,18 @@ struct Door { | |||
45 | struct Exit { | 45 | struct Exit { |
46 | int destination_room; | 46 | int destination_room; |
47 | std::optional<int> door; | 47 | std::optional<int> door; |
48 | bool painting = false; | ||
49 | }; | ||
50 | |||
51 | struct PaintingExit { | ||
52 | std::string id; | ||
53 | std::optional<int> door; | ||
48 | }; | 54 | }; |
49 | 55 | ||
50 | struct Room { | 56 | struct Room { |
51 | std::string name; | 57 | std::string name; |
52 | std::vector<Exit> exits; | 58 | std::vector<Exit> exits; |
59 | std::vector<PaintingExit> paintings; | ||
53 | }; | 60 | }; |
54 | 61 | ||
55 | struct Location { | 62 | struct Location { |
@@ -87,6 +94,10 @@ class GameData { | |||
87 | 94 | ||
88 | const Panel& GetPanel(int panel_id) const { return panels_.at(panel_id); } | 95 | const Panel& GetPanel(int panel_id) const { return panels_.at(panel_id); } |
89 | 96 | ||
97 | int GetRoomForPainting(const std::string& painting_id) const { | ||
98 | return room_by_painting_.at(painting_id); | ||
99 | } | ||
100 | |||
90 | private: | 101 | private: |
91 | int AddOrGetRoom(std::string room); | 102 | int AddOrGetRoom(std::string room); |
92 | int AddOrGetDoor(std::string room, std::string door); | 103 | int AddOrGetDoor(std::string room, std::string door); |
@@ -102,6 +113,8 @@ class GameData { | |||
102 | std::map<std::string, int> door_by_id_; | 113 | std::map<std::string, int> door_by_id_; |
103 | std::map<std::string, int> panel_by_id_; | 114 | std::map<std::string, int> panel_by_id_; |
104 | std::map<std::string, int> area_by_id_; | 115 | std::map<std::string, int> area_by_id_; |
116 | |||
117 | std::map<std::string, int> room_by_painting_; | ||
105 | }; | 118 | }; |
106 | 119 | ||
107 | const GameData& GetGameData(); | 120 | const GameData& GetGameData(); |