about summary refs log tree commit diff stats
path: root/src/game_data.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/game_data.h')
-rw-r--r--src/game_data.h59
1 files changed, 9 insertions, 50 deletions
diff --git a/src/game_data.h b/src/game_data.h index 0cc7a7b..75eede3 100644 --- a/src/game_data.h +++ b/src/game_data.h
@@ -81,55 +81,14 @@ struct MapArea {
81 int map_y; 81 int map_y;
82}; 82};
83 83
84class GameData { 84const std::vector<MapArea>& GD_GetMapAreas();
85 public: 85const MapArea& GD_GetMapArea(int id);
86 GameData(); 86int GD_GetRoomByName(const std::string& name);
87 87const Room& GD_GetRoom(int room_id);
88 const std::vector<MapArea>& GetMapAreas() const { return map_areas_; } 88const std::vector<Door>& GD_GetDoors();
89 89const Door& GD_GetDoor(int door_id);
90 const MapArea& GetMapArea(int id) const { return map_areas_.at(id); } 90const Panel& GD_GetPanel(int panel_id);
91 91int GD_GetRoomForPainting(const std::string& painting_id);
92 int GetRoomByName(const std::string& name) const { 92const std::vector<int>& GD_GetAchievementPanels();
93 return room_by_id_.at(name);
94 }
95
96 const Room& GetRoom(int room_id) const { return rooms_.at(room_id); }
97
98 const std::vector<Door>& GetDoors() const { return doors_; }
99
100 const Door& GetDoor(int door_id) const { return doors_.at(door_id); }
101
102 const Panel& GetPanel(int panel_id) const { return panels_.at(panel_id); }
103
104 int GetRoomForPainting(const std::string& painting_id) const {
105 return room_by_painting_.at(painting_id);
106 }
107
108 const std::vector<int>& GetAchievementPanels() const {
109 return achievement_panels_;
110 }
111
112 private:
113 int AddOrGetRoom(std::string room);
114 int AddOrGetDoor(std::string room, std::string door);
115 int AddOrGetPanel(std::string room, std::string panel);
116 int AddOrGetArea(std::string area);
117
118 std::vector<Room> rooms_;
119 std::vector<Door> doors_;
120 std::vector<Panel> panels_;
121 std::vector<MapArea> map_areas_;
122
123 std::map<std::string, int> room_by_id_;
124 std::map<std::string, int> door_by_id_;
125 std::map<std::string, int> panel_by_id_;
126 std::map<std::string, int> area_by_id_;
127
128 std::map<std::string, int> room_by_painting_;
129
130 std::vector<int> achievement_panels_;
131};
132
133const GameData& GetGameData();
134 93
135#endif /* end of include guard: GAME_DATA_H_9C42AC51 */ 94#endif /* end of include guard: GAME_DATA_H_9C42AC51 */