summary refs log tree commit diff stats
path: root/tools/validator/human_processor.cpp
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2025-08-18 12:56:13 -0400
committerStar Rauchenberger <fefferburbia@gmail.com>2025-08-18 12:56:13 -0400
commit1ac21d4a67ddd211fda841aa6e368bc2cf52a3d6 (patch)
treebdcf651c156c27982e37bddb7cb7e0b09aa90d5a /tools/validator/human_processor.cpp
parent15b8794bbe80be0bcf1f482674455efe002cec2c (diff)
downloadlingo2-archipelago-1ac21d4a67ddd211fda841aa6e368bc2cf52a3d6.tar.gz
lingo2-archipelago-1ac21d4a67ddd211fda841aa6e368bc2cf52a3d6.tar.bz2
lingo2-archipelago-1ac21d4a67ddd211fda841aa6e368bc2cf52a3d6.zip
Validate that nodes in game files are used
You can now also list out nodes that you are explicitly not mapping out. The current state of the repo does produce some warnings when the validator is run and they're either endings, paintings that I'm not sure what to do with yet, and weird proxy stuff I'm not sure how to handle yet.
Diffstat (limited to 'tools/validator/human_processor.cpp')
-rw-r--r--tools/validator/human_processor.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/tools/validator/human_processor.cpp b/tools/validator/human_processor.cpp index 0846bb8..af40980 100644 --- a/tools/validator/human_processor.cpp +++ b/tools/validator/human_processor.cpp
@@ -55,11 +55,26 @@ class HumanProcessor {
55 void ProcessMap(std::filesystem::path path) { 55 void ProcessMap(std::filesystem::path path) {
56 std::string map_name = path.filename().string(); 56 std::string map_name = path.filename().string();
57 57
58 ProcessMetadataFile(path / "metadata.txtpb", map_name);
58 ProcessConnectionsFile(path / "connections.txtpb", map_name); 59 ProcessConnectionsFile(path / "connections.txtpb", map_name);
59 ProcessDoorsFile(path / "doors.txtpb", map_name); 60 ProcessDoorsFile(path / "doors.txtpb", map_name);
60 ProcessRooms(path / "rooms", map_name); 61 ProcessRooms(path / "rooms", map_name);
61 } 62 }
62 63
64 void ProcessMetadataFile(std::filesystem::path path,
65 const std::string& current_map_name) {
66 if (!std::filesystem::exists(path)) {
67 return;
68 }
69
70 MapInfo& map_info = info_.maps[current_map_name];
71
72 auto metadata = ReadMessageFromFile<HumanMap>(path.string());
73 for (const std::string& path : metadata.excluded_nodes()) {
74 map_info.game_nodes[path].uses++;
75 }
76 }
77
63 void ProcessRooms(std::filesystem::path path, 78 void ProcessRooms(std::filesystem::path path,
64 const std::string& current_map_name) { 79 const std::string& current_map_name) {
65 for (auto const& dir_entry : std::filesystem::directory_iterator(path)) { 80 for (auto const& dir_entry : std::filesystem::directory_iterator(path)) {