diff options
Diffstat (limited to 'game_data.h')
-rw-r--r-- | game_data.h | 86 |
1 files changed, 86 insertions, 0 deletions
diff --git a/game_data.h b/game_data.h new file mode 100644 index 0000000..f74f033 --- /dev/null +++ b/game_data.h | |||
@@ -0,0 +1,86 @@ | |||
1 | #ifndef GAME_DATA_H_9C42AC51 | ||
2 | #define GAME_DATA_H_9C42AC51 | ||
3 | |||
4 | #include <map> | ||
5 | #include <string> | ||
6 | #include <vector> | ||
7 | |||
8 | enum class LingoColor { | ||
9 | kNone, | ||
10 | kBlack, | ||
11 | kRed, | ||
12 | kBlue, | ||
13 | kYellow, | ||
14 | kGreen, | ||
15 | kOrange, | ||
16 | kPurple, | ||
17 | kBrown, | ||
18 | kGray | ||
19 | }; | ||
20 | |||
21 | struct Panel { | ||
22 | int room; | ||
23 | std::string name; | ||
24 | std::vector<LingoColor> colors; | ||
25 | std::vector<int> required_rooms; | ||
26 | std::vector<int> required_doors; | ||
27 | bool check = false; | ||
28 | bool exclude_reduce = false; | ||
29 | }; | ||
30 | |||
31 | struct Door { | ||
32 | int room; | ||
33 | std::string name; | ||
34 | std::string location_name; | ||
35 | std::string item_name; | ||
36 | std::string group_name; | ||
37 | bool skip_location = false; | ||
38 | std::vector<int> panels; | ||
39 | bool exclude_reduce = true; | ||
40 | }; | ||
41 | |||
42 | struct Exit { | ||
43 | int destination_room; | ||
44 | std::optional<int> door; | ||
45 | }; | ||
46 | |||
47 | struct Room { | ||
48 | std::string name; | ||
49 | std::vector<Exit> exits; | ||
50 | }; | ||
51 | |||
52 | struct Location { | ||
53 | std::string name; | ||
54 | int location_id; | ||
55 | int room; | ||
56 | std::vector<int> panels; | ||
57 | }; | ||
58 | |||
59 | struct MapArea { | ||
60 | std::string name; | ||
61 | std::vector<Location> locations; | ||
62 | int map_x; | ||
63 | int map_y; | ||
64 | }; | ||
65 | |||
66 | class GameData { | ||
67 | public: | ||
68 | GameData(); | ||
69 | |||
70 | private: | ||
71 | int AddOrGetRoom(std::string room); | ||
72 | int AddOrGetDoor(std::string room, std::string door); | ||
73 | int AddOrGetPanel(std::string room, std::string panel); | ||
74 | |||
75 | std::vector<Room> rooms_; | ||
76 | std::vector<Door> doors_; | ||
77 | std::vector<Panel> panels_; | ||
78 | |||
79 | std::map<std::string, int> room_by_id_; | ||
80 | std::map<std::string, int> door_by_id_; | ||
81 | std::map<std::string, int> panel_by_id_; | ||
82 | }; | ||
83 | |||
84 | const GameData &GetGameData(); | ||
85 | |||
86 | #endif /* end of include guard: GAME_DATA_H_9C42AC51 */ | ||