From a3972a65b9b443a6085a6ac40b153442e190f382 Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Mon, 1 Sep 2025 12:54:46 -0400 Subject: Added progressive doors --- tools/validator/human_processor.cpp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'tools/validator/human_processor.cpp') 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 { ProcessConnectionsFile(datadir_path / "connections.txtpb", std::nullopt); ProcessMaps(datadir_path); + ProcessProgressivesFile(datadir_path / "progressives.txtpb"); ProcessIdsFile(datadir_path / "ids.txtpb"); } @@ -481,6 +482,33 @@ class HumanProcessor { } } + void ProcessProgressivesFile(std::filesystem::path path) { + if (!std::filesystem::exists(path)) { + return; + } + + auto h_progs = ReadMessageFromFile(path.string()); + + for (const HumanProgressive& h_prog : h_progs.progressives()) { + ProcessProgressive(h_prog); + } + } + + void ProcessProgressive(const HumanProgressive& h_prog) { + ProgressiveInfo& prog_info = info_.progressives[h_prog.name()]; + prog_info.definitions.push_back(h_prog); + + for (const DoorIdentifier& di : h_prog.doors()) { + if (!di.has_map()) { + prog_info.malformed_doors.push_back(di); + continue; + } + + DoorInfo& door_info = info_.doors[di]; + door_info.progressives_referenced_by.push_back(h_prog.name()); + } + } + void ProcessIdsFile(std::filesystem::path path) { // Ignore this for now. } -- cgit 1.4.1