summary refs log tree commit diff stats
path: root/tools/validator/human_processor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/validator/human_processor.cpp')
-rw-r--r--tools/validator/human_processor.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/tools/validator/human_processor.cpp b/tools/validator/human_processor.cpp index 0f63936..49e7578 100644 --- a/tools/validator/human_processor.cpp +++ b/tools/validator/human_processor.cpp
@@ -41,6 +41,7 @@ class HumanProcessor {
41 41
42 ProcessConnectionsFile(datadir_path / "connections.txtpb", std::nullopt); 42 ProcessConnectionsFile(datadir_path / "connections.txtpb", std::nullopt);
43 ProcessMaps(datadir_path); 43 ProcessMaps(datadir_path);
44 ProcessProgressivesFile(datadir_path / "progressives.txtpb");
44 ProcessIdsFile(datadir_path / "ids.txtpb"); 45 ProcessIdsFile(datadir_path / "ids.txtpb");
45 } 46 }
46 47
@@ -481,6 +482,33 @@ class HumanProcessor {
481 } 482 }
482 } 483 }
483 484
485 void ProcessProgressivesFile(std::filesystem::path path) {
486 if (!std::filesystem::exists(path)) {
487 return;
488 }
489
490 auto h_progs = ReadMessageFromFile<HumanProgressives>(path.string());
491
492 for (const HumanProgressive& h_prog : h_progs.progressives()) {
493 ProcessProgressive(h_prog);
494 }
495 }
496
497 void ProcessProgressive(const HumanProgressive& h_prog) {
498 ProgressiveInfo& prog_info = info_.progressives[h_prog.name()];
499 prog_info.definitions.push_back(h_prog);
500
501 for (const DoorIdentifier& di : h_prog.doors()) {
502 if (!di.has_map()) {
503 prog_info.malformed_doors.push_back(di);
504 continue;
505 }
506
507 DoorInfo& door_info = info_.doors[di];
508 door_info.progressives_referenced_by.push_back(h_prog.name());
509 }
510 }
511
484 void ProcessIdsFile(std::filesystem::path path) { 512 void ProcessIdsFile(std::filesystem::path path) {
485 // Ignore this for now. 513 // Ignore this for now.
486 } 514 }