summary refs log tree commit diff stats
path: root/tools/util/identifiers.h
diff options
context:
space:
mode:
Diffstat (limited to 'tools/util/identifiers.h')
-rw-r--r--tools/util/identifiers.h85
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
10namespace com::fourisland::lingo2_archipelago {
11
12class 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
19class 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
26class 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
34class 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
43class 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
52class 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
61std::optional<RoomIdentifier> GetCompleteRoomIdentifier(
62 RoomIdentifier identifier, std::optional<std::string> map_name);
63
64std::optional<DoorIdentifier> GetCompleteDoorIdentifier(
65 DoorIdentifier identifier, std::optional<std::string> map_name);
66
67std::optional<PortIdentifier> GetCompletePortIdentifier(
68 PortIdentifier identifier, std::optional<std::string> map_name,
69 std::optional<std::string> room_name);
70
71std::optional<PaintingIdentifier> GetCompletePaintingIdentifier(
72 PaintingIdentifier identifier, std::optional<std::string> map_name,
73 std::optional<std::string> room_name);
74
75std::optional<PanelIdentifier> GetCompletePanelIdentifierWithoutAnswer(
76 PanelIdentifier identifier, std::optional<std::string> map_name,
77 std::optional<std::string> room_name);
78
79std::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_ */