diff options
Diffstat (limited to 'tools/validator/human_processor.cpp')
| -rw-r--r-- | tools/validator/human_processor.cpp | 25 |
1 files changed, 22 insertions, 3 deletions
| diff --git a/tools/validator/human_processor.cpp b/tools/validator/human_processor.cpp index fb06d31..0f63936 100644 --- a/tools/validator/human_processor.cpp +++ b/tools/validator/human_processor.cpp | |||
| @@ -1,5 +1,6 @@ | |||
| 1 | #include "human_processor.h" | 1 | #include "human_processor.h" |
| 2 | 2 | ||
| 3 | #include <fmt/core.h> | ||
| 3 | #include <google/protobuf/message.h> | 4 | #include <google/protobuf/message.h> |
| 4 | #include <google/protobuf/text_format.h> | 5 | #include <google/protobuf/text_format.h> |
| 5 | 6 | ||
| @@ -93,7 +94,7 @@ class HumanProcessor { | |||
| 93 | room_info.definitions.push_back(h_room); | 94 | room_info.definitions.push_back(h_room); |
| 94 | 95 | ||
| 95 | for (const HumanPanel& h_panel : h_room.panels()) { | 96 | for (const HumanPanel& h_panel : h_room.panels()) { |
| 96 | ProcessPanel(h_panel, current_map_name, h_room.name()); | 97 | ProcessPanel(h_panel, current_map_name, h_room); |
| 97 | } | 98 | } |
| 98 | 99 | ||
| 99 | for (const HumanPainting& h_painting : h_room.paintings()) { | 100 | for (const HumanPainting& h_painting : h_room.paintings()) { |
| @@ -123,10 +124,10 @@ class HumanProcessor { | |||
| 123 | 124 | ||
| 124 | void ProcessPanel(const HumanPanel& h_panel, | 125 | void ProcessPanel(const HumanPanel& h_panel, |
| 125 | const std::string& current_map_name, | 126 | const std::string& current_map_name, |
| 126 | const std::string& current_room_name) { | 127 | const HumanRoom& h_room) { |
| 127 | PanelIdentifier panel_identifier; | 128 | PanelIdentifier panel_identifier; |
| 128 | panel_identifier.set_map(current_map_name); | 129 | panel_identifier.set_map(current_map_name); |
| 129 | panel_identifier.set_room(current_room_name); | 130 | panel_identifier.set_room(h_room.name()); |
| 130 | panel_identifier.set_name(h_panel.name()); | 131 | panel_identifier.set_name(h_panel.name()); |
| 131 | 132 | ||
| 132 | PanelInfo& panel_info = info_.panels[panel_identifier]; | 133 | PanelInfo& panel_info = info_.panels[panel_identifier]; |
| @@ -155,6 +156,24 @@ class HumanProcessor { | |||
| 155 | RoomInfo& required_room_info = info_.rooms[required_room_identifier]; | 156 | RoomInfo& required_room_info = info_.rooms[required_room_identifier]; |
| 156 | required_room_info.panels_referenced_by.push_back(panel_identifier); | 157 | required_room_info.panels_referenced_by.push_back(panel_identifier); |
| 157 | } | 158 | } |
| 159 | |||
| 160 | std::string map_area_name = current_map_name; | ||
| 161 | if (h_room.has_panel_display_name()) { | ||
| 162 | map_area_name = | ||
| 163 | fmt::format("{} ({})", current_map_name, h_room.panel_display_name()); | ||
| 164 | } | ||
| 165 | |||
| 166 | panel_info.map_area_name = map_area_name; | ||
| 167 | |||
| 168 | std::string panelsanity_name; | ||
| 169 | if (h_panel.has_display_name()) { | ||
| 170 | panelsanity_name = | ||
| 171 | fmt::format("{} - {}", map_area_name, h_panel.display_name()); | ||
| 172 | } else { | ||
| 173 | panelsanity_name = fmt::format("{} - {}", map_area_name, h_panel.name()); | ||
| 174 | } | ||
| 175 | info_.panel_names[panelsanity_name].panels_used_by.push_back( | ||
| 176 | panel_identifier); | ||
| 158 | } | 177 | } |
| 159 | 178 | ||
| 160 | void ProcessPainting(const HumanPainting& h_painting, | 179 | void ProcessPainting(const HumanPainting& h_painting, |
