diff options
Diffstat (limited to 'tools/util/identifiers.h')
-rw-r--r-- | tools/util/identifiers.h | 85 |
1 files changed, 85 insertions, 0 deletions
diff --git a/tools/util/identifiers.h b/tools/util/identifiers.h new file mode 100644 index 0000000..341dee1 --- /dev/null +++ b/tools/util/identifiers.h | |||
@@ -0,0 +1,85 @@ | |||
1 | #ifndef TOOLS_UTIL_IDENTIFIERS_H_ | ||
2 | #define TOOLS_UTIL_IDENTIFIERS_H_ | ||
3 | |||
4 | #include <optional> | ||
5 | #include <string> | ||
6 | #include <utility> | ||
7 | |||
8 | #include "proto/human.pb.h" | ||
9 | |||
10 | namespace com::fourisland::lingo2_archipelago { | ||
11 | |||
12 | class RoomIdentifierLess { | ||
13 | public: | ||
14 | bool operator()(const RoomIdentifier& lhs, const RoomIdentifier& rhs) const { | ||
15 | return std::tie(lhs.map(), lhs.name()) < std::tie(rhs.map(), rhs.name()); | ||
16 | } | ||
17 | }; | ||
18 | |||
19 | class DoorIdentifierLess { | ||
20 | public: | ||
21 | bool operator()(const DoorIdentifier& lhs, const DoorIdentifier& rhs) const { | ||
22 | return std::tie(lhs.map(), lhs.name()) < std::tie(rhs.map(), rhs.name()); | ||
23 | } | ||
24 | }; | ||
25 | |||
26 | class PortIdentifierLess { | ||
27 | public: | ||
28 | bool operator()(const PortIdentifier& lhs, const PortIdentifier& rhs) const { | ||
29 | return std::tie(lhs.map(), lhs.room(), lhs.name()) < | ||
30 | std::tie(rhs.map(), rhs.room(), rhs.name()); | ||
31 | } | ||
32 | }; | ||
33 | |||
34 | class PaintingIdentifierLess { | ||
35 | public: | ||
36 | bool operator()(const PaintingIdentifier& lhs, | ||
37 | const PaintingIdentifier& rhs) const { | ||
38 | return std::tie(lhs.map(), lhs.room(), lhs.name()) < | ||
39 | std::tie(rhs.map(), rhs.room(), rhs.name()); | ||
40 | } | ||
41 | }; | ||
42 | |||
43 | class PanelIdentifierLess { | ||
44 | public: | ||
45 | bool operator()(const PanelIdentifier& lhs, | ||
46 | const PanelIdentifier& rhs) const { | ||
47 | return std::tie(lhs.map(), lhs.room(), lhs.name(), lhs.answer()) < | ||
48 | std::tie(rhs.map(), rhs.room(), rhs.name(), rhs.answer()); | ||
49 | } | ||
50 | }; | ||
51 | |||
52 | class KeyholderIdentifierLess { | ||
53 | public: | ||
54 | bool operator()(const KeyholderIdentifier& lhs, | ||
55 | const KeyholderIdentifier& rhs) const { | ||
56 | return std::tie(lhs.map(), lhs.room(), lhs.name(), lhs.key()) < | ||
57 | std::tie(rhs.map(), rhs.room(), rhs.name(), rhs.key()); | ||
58 | } | ||
59 | }; | ||
60 | |||
61 | std::optional<RoomIdentifier> GetCompleteRoomIdentifier( | ||
62 | RoomIdentifier identifier, std::optional<std::string> map_name); | ||
63 | |||
64 | std::optional<DoorIdentifier> GetCompleteDoorIdentifier( | ||
65 | DoorIdentifier identifier, std::optional<std::string> map_name); | ||
66 | |||
67 | std::optional<PortIdentifier> GetCompletePortIdentifier( | ||
68 | PortIdentifier identifier, std::optional<std::string> map_name, | ||
69 | std::optional<std::string> room_name); | ||
70 | |||
71 | std::optional<PaintingIdentifier> GetCompletePaintingIdentifier( | ||
72 | PaintingIdentifier identifier, std::optional<std::string> map_name, | ||
73 | std::optional<std::string> room_name); | ||
74 | |||
75 | std::optional<PanelIdentifier> GetCompletePanelIdentifierWithoutAnswer( | ||
76 | PanelIdentifier identifier, std::optional<std::string> map_name, | ||
77 | std::optional<std::string> room_name); | ||
78 | |||
79 | std::optional<KeyholderIdentifier> GetCompleteKeyholderIdentifierWithoutKey( | ||
80 | KeyholderIdentifier identifier, const std::string& map_name, | ||
81 | std::optional<std::string> room_name); | ||
82 | |||
83 | } // namespace com::fourisland::lingo2_archipelago | ||
84 | |||
85 | #endif /* TOOLS_UTIL_IDENTIFIERS_H_ */ | ||