about summary refs log tree commit diff stats
path: root/tools/validator/validator.cpp
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2025-09-11 20:08:32 -0400
committerStar Rauchenberger <fefferburbia@gmail.com>2025-09-11 20:08:32 -0400
commitfcfefe57d9d0b9d8eb3e149e68605103a9e6b490 (patch)
tree415058cc3361727390c4d92ad367ec8c59350974 /tools/validator/validator.cpp
parent6ba1787f7229125affbf12a94c4ddfb6b2e132b8 (diff)
downloadlingo2-archipelago-fcfefe57d9d0b9d8eb3e149e68605103a9e6b490.tar.gz
lingo2-archipelago-fcfefe57d9d0b9d8eb3e149e68605103a9e6b490.tar.bz2
lingo2-archipelago-fcfefe57d9d0b9d8eb3e149e68605103a9e6b490.zip
[Data] Fixed connection target required door logic bugs
Diffstat (limited to 'tools/validator/validator.cpp')
-rw-r--r--tools/validator/validator.cpp48
1 files changed, 48 insertions, 0 deletions
diff --git a/tools/validator/validator.cpp b/tools/validator/validator.cpp index 4149caa..e4c6324 100644 --- a/tools/validator/validator.cpp +++ b/tools/validator/validator.cpp
@@ -256,6 +256,22 @@ class Validator {
256 std::cout << "Port " << port_identifier.ShortDebugString() 256 std::cout << "Port " << port_identifier.ShortDebugString()
257 << " was defined multiple times." << std::endl; 257 << " was defined multiple times." << std::endl;
258 } 258 }
259
260 if (!port_info.target_connections_referenced_by.empty()) {
261 for (const HumanPort& port : port_info.definitions) {
262 if (port.has_required_door()) {
263 std::cout << "Port " << port_identifier.ShortDebugString()
264 << " has a required door but is the target of a connection:"
265 << std::endl;
266
267 for (const HumanConnection& connection :
268 port_info.target_connections_referenced_by) {
269 std::cout << " CONNECTION " << connection.ShortDebugString()
270 << std::endl;
271 }
272 }
273 }
274 }
259 } 275 }
260 276
261 void ValidatePainting(const PaintingIdentifier& painting_identifier, 277 void ValidatePainting(const PaintingIdentifier& painting_identifier,
@@ -279,6 +295,22 @@ class Validator {
279 std::cout << "Painting " << painting_identifier.ShortDebugString() 295 std::cout << "Painting " << painting_identifier.ShortDebugString()
280 << " was defined multiple times." << std::endl; 296 << " was defined multiple times." << std::endl;
281 } 297 }
298
299 if (!painting_info.target_connections_referenced_by.empty()) {
300 for (const HumanPainting& painting : painting_info.definitions) {
301 if (painting.has_required_door()) {
302 std::cout << "Painting " << painting_identifier.ShortDebugString()
303 << " has a required door but is the target of a connection:"
304 << std::endl;
305
306 for (const HumanConnection& connection :
307 painting_info.target_connections_referenced_by) {
308 std::cout << " CONNECTION " << connection.ShortDebugString()
309 << std::endl;
310 }
311 }
312 }
313 }
282 } 314 }
283 315
284 void ValidatePanel(const PanelIdentifier& panel_identifier, 316 void ValidatePanel(const PanelIdentifier& panel_identifier,
@@ -340,6 +372,22 @@ class Validator {
340 std::cout << "Panel " << panel_identifier.ShortDebugString() 372 std::cout << "Panel " << panel_identifier.ShortDebugString()
341 << " is missing an AP ID." << std::endl; 373 << " is missing an AP ID." << std::endl;
342 } 374 }
375
376 if (!panel_info.target_connections_referenced_by.empty()) {
377 for (const HumanPanel& panel : panel_info.definitions) {
378 if (panel.has_required_door()) {
379 std::cout << "Panel " << panel_identifier.ShortDebugString()
380 << " has a required door but is the target of a connection:"
381 << std::endl;
382
383 for (const HumanConnection& connection :
384 panel_info.target_connections_referenced_by) {
385 std::cout << " CONNECTION " << connection.ShortDebugString()
386 << std::endl;
387 }
388 }
389 }
390 }
343 } 391 }
344 392
345 void ValidateKeyholder(const KeyholderIdentifier& keyholder_identifier, 393 void ValidateKeyholder(const KeyholderIdentifier& keyholder_identifier,