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