about summary refs log tree commit diff stats
path: root/game_data.h
diff options
context:
space:
mode:
Diffstat (limited to 'game_data.h')
-rw-r--r--game_data.h13
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 {
45struct Exit { 45struct 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
51struct PaintingExit {
52 std::string id;
53 std::optional<int> door;
48}; 54};
49 55
50struct Room { 56struct 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
55struct Location { 62struct 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
107const GameData& GetGameData(); 120const GameData& GetGameData();