From 1ac21d4a67ddd211fda841aa6e368bc2cf52a3d6 Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Mon, 18 Aug 2025 12:56:13 -0400 Subject: 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. --- tools/validator/human_processor.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'tools/validator/human_processor.cpp') 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 { void ProcessMap(std::filesystem::path path) { std::string map_name = path.filename().string(); + ProcessMetadataFile(path / "metadata.txtpb", map_name); ProcessConnectionsFile(path / "connections.txtpb", map_name); ProcessDoorsFile(path / "doors.txtpb", map_name); ProcessRooms(path / "rooms", map_name); } + void ProcessMetadataFile(std::filesystem::path path, + const std::string& current_map_name) { + if (!std::filesystem::exists(path)) { + return; + } + + MapInfo& map_info = info_.maps[current_map_name]; + + auto metadata = ReadMessageFromFile(path.string()); + for (const std::string& path : metadata.excluded_nodes()) { + map_info.game_nodes[path].uses++; + } + } + void ProcessRooms(std::filesystem::path path, const std::string& current_map_name) { for (auto const& dir_entry : std::filesystem::directory_iterator(path)) { -- cgit 1.4.1