about summary refs log tree commit diff stats
path: root/tools/validator
diff options
context:
space:
mode:
Diffstat (limited to 'tools/validator')
-rw-r--r--tools/validator/human_processor.cpp20
-rw-r--r--tools/validator/structs.h1
-rw-r--r--tools/validator/validator.cpp13
3 files changed, 29 insertions, 5 deletions
diff --git a/tools/validator/human_processor.cpp b/tools/validator/human_processor.cpp index 407d951..ffa9765 100644 --- a/tools/validator/human_processor.cpp +++ b/tools/validator/human_processor.cpp
@@ -570,12 +570,14 @@ class HumanProcessor {
570 auto ids = ReadIdsFromYaml(path.string()); 570 auto ids = ReadIdsFromYaml(path.string());
571 571
572 DoorIdentifier di; 572 DoorIdentifier di;
573 PanelIdentifier pi; 573 PanelIdentifier pai;
574 PortIdentifier poi;
574 KeyholderIdentifier ki; 575 KeyholderIdentifier ki;
575 576
576 for (const auto& [map_name, map] : ids.maps()) { 577 for (const auto& [map_name, map] : ids.maps()) {
577 di.set_map(map_name); 578 di.set_map(map_name);
578 pi.set_map(map_name); 579 pai.set_map(map_name);
580 poi.set_map(map_name);
579 ki.set_map(map_name); 581 ki.set_map(map_name);
580 582
581 for (const auto& [door_name, ap_id] : map.doors()) { 583 for (const auto& [door_name, ap_id] : map.doors()) {
@@ -586,13 +588,14 @@ class HumanProcessor {
586 } 588 }
587 589
588 for (const auto& [room_name, room] : map.rooms()) { 590 for (const auto& [room_name, room] : map.rooms()) {
589 pi.set_room(room_name); 591 pai.set_room(room_name);
592 poi.set_room(room_name);
590 ki.set_room(room_name); 593 ki.set_room(room_name);
591 594
592 for (const auto& [panel_name, ap_id] : room.panels()) { 595 for (const auto& [panel_name, ap_id] : room.panels()) {
593 pi.set_name(panel_name); 596 pai.set_name(panel_name);
594 597
595 PanelInfo& panel_info = info_.panels[pi]; 598 PanelInfo& panel_info = info_.panels[pai];
596 panel_info.has_id = true; 599 panel_info.has_id = true;
597 } 600 }
598 601
@@ -606,6 +609,13 @@ class HumanProcessor {
606 KeyholderInfo& keyholder_info = info_.keyholders[ki]; 609 KeyholderInfo& keyholder_info = info_.keyholders[ki];
607 keyholder_info.has_id = true; 610 keyholder_info.has_id = true;
608 } 611 }
612
613 for (const auto& [port_name, ap_id] : room.ports()) {
614 poi.set_name(port_name);
615
616 PortInfo& port_info = info_.ports[poi];
617 port_info.has_id = true;
618 }
609 } 619 }
610 } 620 }
611 621
diff --git a/tools/validator/structs.h b/tools/validator/structs.h index 51215e9..62974a8 100644 --- a/tools/validator/structs.h +++ b/tools/validator/structs.h
@@ -56,6 +56,7 @@ struct DoorInfo {
56 56
57struct PortInfo { 57struct PortInfo {
58 std::vector<HumanPort> definitions; 58 std::vector<HumanPort> definitions;
59 bool has_id = false;
59 60
60 std::vector<HumanConnection> connections_referenced_by; 61 std::vector<HumanConnection> connections_referenced_by;
61 std::vector<HumanConnection> target_connections_referenced_by; 62 std::vector<HumanConnection> target_connections_referenced_by;
diff --git a/tools/validator/validator.cpp b/tools/validator/validator.cpp index 5f8e0ba..a99447a 100644 --- a/tools/validator/validator.cpp +++ b/tools/validator/validator.cpp
@@ -269,6 +269,10 @@ class Validator {
269 for (const std::string& map_name : port_info.map_worldport_entrances) { 269 for (const std::string& map_name : port_info.map_worldport_entrances) {
270 std::cout << " MAP (worldport_entrance) " << map_name << std::endl; 270 std::cout << " MAP (worldport_entrance) " << map_name << std::endl;
271 } 271 }
272
273 if (port_info.has_id) {
274 std::cout << " An AP ID is present." << std::endl;
275 }
272 } else if (port_info.definitions.size() > 1) { 276 } else if (port_info.definitions.size() > 1) {
273 std::cout << "Port " << port_identifier.ShortDebugString() 277 std::cout << "Port " << port_identifier.ShortDebugString()
274 << " was defined multiple times." << std::endl; 278 << " was defined multiple times." << std::endl;
@@ -301,6 +305,15 @@ class Validator {
301 std::cout << "Port " << port_identifier.ShortDebugString() 305 std::cout << "Port " << port_identifier.ShortDebugString()
302 << " is shuffleable and missing a rotation." << std::endl; 306 << " is shuffleable and missing a rotation." << std::endl;
303 } 307 }
308 if (!port_info.has_id) {
309 std::cout << "Port " << port_identifier.ShortDebugString()
310 << " is missing an AP ID." << std::endl;
311 }
312 } else {
313 if (port_info.has_id) {
314 std::cout << "Port " << port_identifier.ShortDebugString()
315 << " should not have an AP ID." << std::endl;
316 }
304 } 317 }
305 } 318 }
306 } 319 }