diff options
| author | Star Rauchenberger <fefferburbia@gmail.com> | 2025-09-01 12:54:46 -0400 |
|---|---|---|
| committer | Star Rauchenberger <fefferburbia@gmail.com> | 2025-09-01 12:54:46 -0400 |
| commit | a3972a65b9b443a6085a6ac40b153442e190f382 (patch) | |
| tree | 8291258115a066f99c972005557208cb9dbd8899 /tools/validator/human_processor.cpp | |
| parent | d142ae3408d3e26e12d7dfaa6a7ccbcf56042957 (diff) | |
| download | lingo2-archipelago-a3972a65b9b443a6085a6ac40b153442e190f382.tar.gz lingo2-archipelago-a3972a65b9b443a6085a6ac40b153442e190f382.tar.bz2 lingo2-archipelago-a3972a65b9b443a6085a6ac40b153442e190f382.zip | |
Added progressive doors
Diffstat (limited to 'tools/validator/human_processor.cpp')
| -rw-r--r-- | tools/validator/human_processor.cpp | 28 |
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 | } |
