diff options
author | Star Rauchenberger <fefferburbia@gmail.com> | 2025-08-07 13:34:42 -0400 |
---|---|---|
committer | Star Rauchenberger <fefferburbia@gmail.com> | 2025-08-07 13:34:42 -0400 |
commit | e9d9da34e86a1e5f0de155bf9086d3e5ff6b2da0 (patch) | |
tree | 432e1177f11e7e2b5e0d6400fad977def7d31129 /tools/datapacker/container.h | |
parent | 1eacf01378d4dff3aed73fffcc42e0352b93835e (diff) | |
download | lingo2-archipelago-e9d9da34e86a1e5f0de155bf9086d3e5ff6b2da0.tar.gz lingo2-archipelago-e9d9da34e86a1e5f0de155bf9086d3e5ff6b2da0.tar.bz2 lingo2-archipelago-e9d9da34e86a1e5f0de155bf9086d3e5ff6b2da0.zip |
Protobuf works! Parsing connections
Diffstat (limited to 'tools/datapacker/container.h')
-rw-r--r-- | tools/datapacker/container.h | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/tools/datapacker/container.h b/tools/datapacker/container.h new file mode 100644 index 0000000..96e5a50 --- /dev/null +++ b/tools/datapacker/container.h | |||
@@ -0,0 +1,65 @@ | |||
1 | #ifndef TOOLS_DATAPACKER_CONTAINER_H_ | ||
2 | #define TOOLS_DATAPACKER_CONTAINER_H_ | ||
3 | |||
4 | #include <cstdint> | ||
5 | #include <map> | ||
6 | #include <optional> | ||
7 | #include <string> | ||
8 | |||
9 | #include "proto/data.pb.h" | ||
10 | |||
11 | namespace com::fourisland::lingo2_archipelago { | ||
12 | |||
13 | class Container { | ||
14 | public: | ||
15 | uint64_t FindOrAddMap(std::string map_name); | ||
16 | |||
17 | uint64_t FindOrAddRoom(std::optional<std::string> map_name, | ||
18 | std::string room_name, | ||
19 | std::optional<std::string> map_fallback); | ||
20 | |||
21 | uint64_t FindOrAddPainting(std::optional<std::string> map_name, | ||
22 | std::optional<std::string> room_name, | ||
23 | std::string painting_name, | ||
24 | std::optional<std::string> map_fallback, | ||
25 | std::optional<std::string> room_fallback); | ||
26 | |||
27 | uint64_t FindOrAddPort(std::optional<std::string> map_name, | ||
28 | std::optional<std::string> room_name, | ||
29 | std::string port_name, | ||
30 | std::optional<std::string> map_fallback, | ||
31 | std::optional<std::string> room_fallback); | ||
32 | |||
33 | uint64_t FindOrAddPanel(std::optional<std::string> map_name, | ||
34 | std::optional<std::string> room_name, | ||
35 | std::string panel_name, | ||
36 | std::optional<std::string> map_fallback, | ||
37 | std::optional<std::string> room_fallback); | ||
38 | |||
39 | uint64_t FindOrAddDoor(std::optional<std::string> map_name, | ||
40 | std::string door_name, | ||
41 | std::optional<std::string> map_fallback); | ||
42 | |||
43 | void AddConnection(const Connection& connection); | ||
44 | |||
45 | const AllObjects& all_objects() const { return all_objects_; } | ||
46 | |||
47 | private: | ||
48 | AllObjects all_objects_; | ||
49 | |||
50 | std::map<std::string, uint64_t> map_id_by_name_; | ||
51 | std::map<std::string, std::map<std::string, uint64_t>> | ||
52 | room_id_by_map_room_names_; | ||
53 | std::map<std::string, std::map<std::string, std::map<std::string, uint64_t>>> | ||
54 | painting_id_by_map_room_painting_names_; | ||
55 | std::map<std::string, std::map<std::string, std::map<std::string, uint64_t>>> | ||
56 | port_id_by_map_room_port_names_; | ||
57 | std::map<std::string, std::map<std::string, std::map<std::string, uint64_t>>> | ||
58 | panel_id_by_map_room_panel_names_; | ||
59 | std::map<std::string, std::map<std::string, uint64_t>> | ||
60 | door_id_by_map_door_names_; | ||
61 | }; | ||
62 | |||
63 | } // namespace com::fourisland::lingo2_archipelago | ||
64 | |||
65 | #endif /* TOOLS_DATAPACKER_CONTAINER_H_ */ | ||