diff options
Diffstat (limited to 'tools/validator/structs.h')
| -rw-r--r-- | tools/validator/structs.h | 147 |
1 files changed, 147 insertions, 0 deletions
| diff --git a/tools/validator/structs.h b/tools/validator/structs.h new file mode 100644 index 0000000..d1d45f2 --- /dev/null +++ b/tools/validator/structs.h | |||
| @@ -0,0 +1,147 @@ | |||
| 1 | #ifndef TOOLS_VALIDATOR_STRUCTS_H_ | ||
| 2 | #define TOOLS_VALIDATOR_STRUCTS_H_ | ||
| 3 | |||
| 4 | #include <map> | ||
| 5 | #include <string> | ||
| 6 | #include <vector> | ||
| 7 | |||
| 8 | #include "proto/human.pb.h" | ||
| 9 | #include "util/identifiers.h" | ||
| 10 | |||
| 11 | namespace com::fourisland::lingo2_archipelago { | ||
| 12 | |||
| 13 | struct MalformedIdentifiers { | ||
| 14 | std::vector<PaintingIdentifier> paintings; | ||
| 15 | std::vector<PanelIdentifier> panels; | ||
| 16 | std::vector<KeyholderIdentifier> keyholders; | ||
| 17 | |||
| 18 | bool HasAny() const { | ||
| 19 | return !paintings.empty() || !panels.empty() || !keyholders.empty(); | ||
| 20 | } | ||
| 21 | }; | ||
| 22 | |||
| 23 | struct GameNodeInfo { | ||
| 24 | bool defined = false; | ||
| 25 | int uses = 0; | ||
| 26 | }; | ||
| 27 | |||
| 28 | struct MapInfo { | ||
| 29 | std::map<std::string, GameNodeInfo> game_nodes; | ||
| 30 | }; | ||
| 31 | |||
| 32 | struct RoomInfo { | ||
| 33 | std::vector<HumanRoom> definitions; | ||
| 34 | |||
| 35 | std::vector<DoorIdentifier> doors_referenced_by; | ||
| 36 | std::vector<PanelIdentifier> panels_referenced_by; | ||
| 37 | std::vector<HumanConnection> connections_referenced_by; | ||
| 38 | }; | ||
| 39 | |||
| 40 | struct DoorInfo { | ||
| 41 | std::vector<HumanDoor> definitions; | ||
| 42 | bool has_id = false; | ||
| 43 | |||
| 44 | std::vector<HumanConnection> connections_referenced_by; | ||
| 45 | std::vector<DoorIdentifier> doors_referenced_by; | ||
| 46 | std::vector<PanelIdentifier> panels_referenced_by; | ||
| 47 | std::vector<PaintingIdentifier> paintings_referenced_by; | ||
| 48 | std::vector<PortIdentifier> ports_referenced_by; | ||
| 49 | std::vector<std::string> progressives_referenced_by; | ||
| 50 | std::vector<std::string> door_groups_referenced_by; | ||
| 51 | |||
| 52 | MalformedIdentifiers malformed_identifiers; | ||
| 53 | }; | ||
| 54 | |||
| 55 | struct PortInfo { | ||
| 56 | std::vector<HumanPort> definitions; | ||
| 57 | |||
| 58 | std::vector<HumanConnection> connections_referenced_by; | ||
| 59 | std::vector<HumanConnection> target_connections_referenced_by; | ||
| 60 | }; | ||
| 61 | |||
| 62 | struct PaintingInfo { | ||
| 63 | std::vector<HumanPainting> definitions; | ||
| 64 | |||
| 65 | std::vector<HumanConnection> connections_referenced_by; | ||
| 66 | std::vector<HumanConnection> target_connections_referenced_by; | ||
| 67 | std::vector<DoorIdentifier> doors_referenced_by; | ||
| 68 | }; | ||
| 69 | |||
| 70 | struct ProxyInfo { | ||
| 71 | std::vector<Proxy> definitions; | ||
| 72 | |||
| 73 | std::vector<HumanConnection> connections_referenced_by; | ||
| 74 | std::vector<DoorIdentifier> doors_referenced_by; | ||
| 75 | }; | ||
| 76 | |||
| 77 | struct PanelInfo { | ||
| 78 | std::vector<HumanPanel> definitions; | ||
| 79 | bool has_id = false; | ||
| 80 | |||
| 81 | std::string map_area_name; | ||
| 82 | |||
| 83 | std::vector<HumanConnection> connections_referenced_by; | ||
| 84 | std::vector<HumanConnection> target_connections_referenced_by; | ||
| 85 | std::vector<DoorIdentifier> doors_referenced_by; | ||
| 86 | |||
| 87 | std::map<std::string, ProxyInfo> proxies; | ||
| 88 | }; | ||
| 89 | |||
| 90 | struct KeyholderInfo { | ||
| 91 | std::vector<HumanKeyholder> definitions; | ||
| 92 | bool has_id = false; | ||
| 93 | |||
| 94 | std::vector<DoorIdentifier> doors_referenced_by; | ||
| 95 | }; | ||
| 96 | |||
| 97 | using LetterIdentifier = std::tuple<char, bool>; | ||
| 98 | |||
| 99 | struct LetterInfo { | ||
| 100 | std::vector<RoomIdentifier> defined_in; | ||
| 101 | bool has_id = false; | ||
| 102 | }; | ||
| 103 | |||
| 104 | struct EndingInfo { | ||
| 105 | std::vector<RoomIdentifier> defined_in; | ||
| 106 | bool has_id = false; | ||
| 107 | |||
| 108 | std::vector<DoorIdentifier> doors_referenced_by; | ||
| 109 | }; | ||
| 110 | |||
| 111 | struct PanelNameInfo { | ||
| 112 | std::vector<PanelIdentifier> panels_used_by; | ||
| 113 | }; | ||
| 114 | |||
| 115 | struct ProgressiveInfo { | ||
| 116 | std::vector<HumanProgressive> definitions; | ||
| 117 | bool has_id = false; | ||
| 118 | |||
| 119 | std::vector<DoorIdentifier> malformed_doors; | ||
| 120 | }; | ||
| 121 | |||
| 122 | struct DoorGroupInfo { | ||
| 123 | std::vector<HumanDoorGroup> definitions; | ||
| 124 | bool has_id = false; | ||
| 125 | |||
| 126 | std::vector<DoorIdentifier> malformed_doors; | ||
| 127 | }; | ||
| 128 | |||
| 129 | struct CollectedInfo { | ||
| 130 | std::map<std::string, MapInfo> maps; | ||
| 131 | std::map<RoomIdentifier, RoomInfo, RoomIdentifierLess> rooms; | ||
| 132 | std::map<DoorIdentifier, DoorInfo, DoorIdentifierLess> doors; | ||
| 133 | std::map<PortIdentifier, PortInfo, PortIdentifierLess> ports; | ||
| 134 | std::map<PaintingIdentifier, PaintingInfo, PaintingIdentifierLess> paintings; | ||
| 135 | std::map<PanelIdentifier, PanelInfo, PanelIdentifierLess> panels; | ||
| 136 | std::map<KeyholderIdentifier, KeyholderInfo, KeyholderIdentifierLess> | ||
| 137 | keyholders; | ||
| 138 | std::map<LetterIdentifier, LetterInfo> letters; | ||
| 139 | std::map<std::string, EndingInfo> endings; | ||
| 140 | std::map<std::string, PanelNameInfo> panel_names; | ||
| 141 | std::map<std::string, ProgressiveInfo> progressives; | ||
| 142 | std::map<std::string, DoorGroupInfo> door_groups; | ||
| 143 | }; | ||
| 144 | |||
| 145 | } // namespace com::fourisland::lingo2_archipelago | ||
| 146 | |||
| 147 | #endif /* TOOLS_VALIDATOR_STRUCTS_H_ */ | ||
