diff options
Diffstat (limited to 'tools/validator/human_processor.cpp')
| -rw-r--r-- | tools/validator/human_processor.cpp | 40 |
1 files changed, 30 insertions, 10 deletions
| diff --git a/tools/validator/human_processor.cpp b/tools/validator/human_processor.cpp index 2c978bf..ffa9765 100644 --- a/tools/validator/human_processor.cpp +++ b/tools/validator/human_processor.cpp | |||
| @@ -77,6 +77,21 @@ class HumanProcessor { | |||
| 77 | for (const std::string& path : metadata.excluded_nodes()) { | 77 | for (const std::string& path : metadata.excluded_nodes()) { |
| 78 | map_info.game_nodes[path].uses++; | 78 | map_info.game_nodes[path].uses++; |
| 79 | } | 79 | } |
| 80 | |||
| 81 | for (const std::string& path : metadata.custom_nodes()) { | ||
| 82 | map_info.game_nodes[path].defined = true; | ||
| 83 | } | ||
| 84 | |||
| 85 | if (metadata.has_worldport_entrance()) { | ||
| 86 | auto port_identifier = GetCompletePortIdentifier( | ||
| 87 | metadata.worldport_entrance(), current_map_name, std::nullopt); | ||
| 88 | if (port_identifier) { | ||
| 89 | PortInfo& port_info = info_.ports[*port_identifier]; | ||
| 90 | port_info.map_worldport_entrances.push_back(current_map_name); | ||
| 91 | } else { | ||
| 92 | map_info.malformed_worldport_entrance = metadata.worldport_entrance(); | ||
| 93 | } | ||
| 94 | } | ||
| 80 | } | 95 | } |
| 81 | 96 | ||
| 82 | void ProcessRooms(std::filesystem::path path, | 97 | void ProcessRooms(std::filesystem::path path, |
| @@ -358,11 +373,6 @@ class HumanProcessor { | |||
| 358 | DoorInfo& other_door_info = info_.doors[complete_door_identifier]; | 373 | DoorInfo& other_door_info = info_.doors[complete_door_identifier]; |
| 359 | other_door_info.doors_referenced_by.push_back(door_identifier); | 374 | other_door_info.doors_referenced_by.push_back(door_identifier); |
| 360 | } | 375 | } |
| 361 | |||
| 362 | for (const std::string& ei : h_door.endings()) { | ||
| 363 | EndingInfo& ending_info = info_.endings[ei]; | ||
| 364 | ending_info.doors_referenced_by.push_back(door_identifier); | ||
| 365 | } | ||
| 366 | } | 376 | } |
| 367 | 377 | ||
| 368 | void ProcessConnectionsFile(std::filesystem::path path, | 378 | void ProcessConnectionsFile(std::filesystem::path path, |
| @@ -560,12 +570,14 @@ class HumanProcessor { | |||
| 560 | auto ids = ReadIdsFromYaml(path.string()); | 570 | auto ids = ReadIdsFromYaml(path.string()); |
| 561 | 571 | ||
| 562 | DoorIdentifier di; | 572 | DoorIdentifier di; |
| 563 | PanelIdentifier pi; | 573 | PanelIdentifier pai; |
| 574 | PortIdentifier poi; | ||
| 564 | KeyholderIdentifier ki; | 575 | KeyholderIdentifier ki; |
| 565 | 576 | ||
| 566 | for (const auto& [map_name, map] : ids.maps()) { | 577 | for (const auto& [map_name, map] : ids.maps()) { |
| 567 | di.set_map(map_name); | 578 | di.set_map(map_name); |
| 568 | pi.set_map(map_name); | 579 | pai.set_map(map_name); |
| 580 | poi.set_map(map_name); | ||
| 569 | ki.set_map(map_name); | 581 | ki.set_map(map_name); |
| 570 | 582 | ||
| 571 | for (const auto& [door_name, ap_id] : map.doors()) { | 583 | for (const auto& [door_name, ap_id] : map.doors()) { |
| @@ -576,13 +588,14 @@ class HumanProcessor { | |||
| 576 | } | 588 | } |
| 577 | 589 | ||
| 578 | for (const auto& [room_name, room] : map.rooms()) { | 590 | for (const auto& [room_name, room] : map.rooms()) { |
| 579 | pi.set_room(room_name); | 591 | pai.set_room(room_name); |
| 592 | poi.set_room(room_name); | ||
| 580 | ki.set_room(room_name); | 593 | ki.set_room(room_name); |
| 581 | 594 | ||
| 582 | for (const auto& [panel_name, ap_id] : room.panels()) { | 595 | for (const auto& [panel_name, ap_id] : room.panels()) { |
| 583 | pi.set_name(panel_name); | 596 | pai.set_name(panel_name); |
| 584 | 597 | ||
| 585 | PanelInfo& panel_info = info_.panels[pi]; | 598 | PanelInfo& panel_info = info_.panels[pai]; |
| 586 | panel_info.has_id = true; | 599 | panel_info.has_id = true; |
| 587 | } | 600 | } |
| 588 | 601 | ||
| @@ -596,6 +609,13 @@ class HumanProcessor { | |||
| 596 | KeyholderInfo& keyholder_info = info_.keyholders[ki]; | 609 | KeyholderInfo& keyholder_info = info_.keyholders[ki]; |
| 597 | keyholder_info.has_id = true; | 610 | keyholder_info.has_id = true; |
| 598 | } | 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 | } | ||
| 599 | } | 619 | } |
| 600 | } | 620 | } |
| 601 | 621 | ||
