diff options
Diffstat (limited to 'tools/validator/human_processor.cpp')
| -rw-r--r-- | tools/validator/human_processor.cpp | 15 |
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)) { |
