diff options
Diffstat (limited to 'tools/validator/validator.cpp')
-rw-r--r-- | tools/validator/validator.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tools/validator/validator.cpp b/tools/validator/validator.cpp index 3381ed2..f2ec280 100644 --- a/tools/validator/validator.cpp +++ b/tools/validator/validator.cpp | |||
@@ -9,6 +9,15 @@ | |||
9 | namespace com::fourisland::lingo2_archipelago { | 9 | namespace com::fourisland::lingo2_archipelago { |
10 | namespace { | 10 | namespace { |
11 | 11 | ||
12 | void ValidateMap(const std::string& map_name, const MapInfo& map_info) { | ||
13 | for (const auto& [node_path, node_info] : map_info.game_nodes) { | ||
14 | if (node_info.uses > 1) { | ||
15 | std::cout << "Map " << map_name << " node " << node_path | ||
16 | << " is used in multiple places." << std::endl; | ||
17 | } | ||
18 | } | ||
19 | } | ||
20 | |||
12 | void ValidateRoom(const RoomIdentifier& room_identifier, | 21 | void ValidateRoom(const RoomIdentifier& room_identifier, |
13 | const RoomInfo& room_info) { | 22 | const RoomInfo& room_info) { |
14 | if (room_info.definitions.empty()) { | 23 | if (room_info.definitions.empty()) { |
@@ -224,6 +233,9 @@ void ValidateLetter(const LetterIdentifier& letter_identifier, | |||
224 | } // namespace | 233 | } // namespace |
225 | 234 | ||
226 | void ValidateCollectedInfo(const CollectedInfo& info) { | 235 | void ValidateCollectedInfo(const CollectedInfo& info) { |
236 | for (const auto& [map_name, map_info] : info.maps) { | ||
237 | ValidateMap(map_name, map_info); | ||
238 | } | ||
227 | for (const auto& [room_identifier, room_info] : info.rooms) { | 239 | for (const auto& [room_identifier, room_info] : info.rooms) { |
228 | ValidateRoom(room_identifier, room_info); | 240 | ValidateRoom(room_identifier, room_info); |
229 | } | 241 | } |