diff options
Diffstat (limited to 'tools/datapacker')
| -rw-r--r-- | tools/datapacker/container.cpp | 54 | ||||
| -rw-r--r-- | tools/datapacker/container.h | 9 | ||||
| -rw-r--r-- | tools/datapacker/main.cpp | 162 |
3 files changed, 214 insertions, 11 deletions
| diff --git a/tools/datapacker/container.cpp b/tools/datapacker/container.cpp index ffcb75a..4a656b3 100644 --- a/tools/datapacker/container.cpp +++ b/tools/datapacker/container.cpp | |||
| @@ -79,7 +79,7 @@ uint64_t Container::FindOrAddPainting( | |||
| 79 | auto it = room_container.find(painting_name); | 79 | auto it = room_container.find(painting_name); |
| 80 | if (it == room_container.end()) { | 80 | if (it == room_container.end()) { |
| 81 | uint64_t new_id = all_objects_.paintings_size(); | 81 | uint64_t new_id = all_objects_.paintings_size(); |
| 82 | Painting* painting = all_objects_.add_paintings(); | 82 | PaintingData* painting = all_objects_.add_paintings(); |
| 83 | painting->set_id(new_id); | 83 | painting->set_id(new_id); |
| 84 | painting->set_room_id(FindOrAddRoom(map_name, *room_name, std::nullopt)); | 84 | painting->set_room_id(FindOrAddRoom(map_name, *room_name, std::nullopt)); |
| 85 | painting->set_name(painting_name); | 85 | painting->set_name(painting_name); |
| @@ -205,6 +205,22 @@ uint64_t Container::FindLetterByName(std::string letter_name) { | |||
| 205 | } | 205 | } |
| 206 | } | 206 | } |
| 207 | 207 | ||
| 208 | uint64_t Container::FindOrAddEnding(std::string ending_name) { | ||
| 209 | auto it = ending_id_by_name_.find(ending_name); | ||
| 210 | if (it == ending_id_by_name_.end()) { | ||
| 211 | uint64_t new_id = all_objects_.endings_size(); | ||
| 212 | Ending* ending = all_objects_.add_endings(); | ||
| 213 | ending->set_id(new_id); | ||
| 214 | ending->set_name(ending_name); | ||
| 215 | |||
| 216 | ending_id_by_name_[ending_name] = new_id; | ||
| 217 | |||
| 218 | return new_id; | ||
| 219 | } else { | ||
| 220 | return it->second; | ||
| 221 | } | ||
| 222 | } | ||
| 223 | |||
| 208 | uint64_t Container::FindOrAddMastery(std::optional<std::string> map_name, | 224 | uint64_t Container::FindOrAddMastery(std::optional<std::string> map_name, |
| 209 | std::optional<std::string> room_name, | 225 | std::optional<std::string> room_name, |
| 210 | std::string mastery_name, | 226 | std::string mastery_name, |
| @@ -273,7 +289,7 @@ uint64_t Container::FindOrAddKeyholder( | |||
| 273 | auto it = room_container.find(keyholder_name); | 289 | auto it = room_container.find(keyholder_name); |
| 274 | if (it == room_container.end()) { | 290 | if (it == room_container.end()) { |
| 275 | uint64_t new_id = all_objects_.keyholders_size(); | 291 | uint64_t new_id = all_objects_.keyholders_size(); |
| 276 | Keyholder* keyholder = all_objects_.add_keyholders(); | 292 | KeyholderData* keyholder = all_objects_.add_keyholders(); |
| 277 | keyholder->set_id(new_id); | 293 | keyholder->set_id(new_id); |
| 278 | keyholder->set_room_id(FindOrAddRoom(map_name, *room_name, std::nullopt)); | 294 | keyholder->set_room_id(FindOrAddRoom(map_name, *room_name, std::nullopt)); |
| 279 | keyholder->set_name(keyholder_name); | 295 | keyholder->set_name(keyholder_name); |
| @@ -315,6 +331,40 @@ uint64_t Container::FindOrAddDoor(std::optional<std::string> map_name, | |||
| 315 | } | 331 | } |
| 316 | } | 332 | } |
| 317 | 333 | ||
| 334 | uint64_t Container::FindOrAddProgressive(std::string prog_name) { | ||
| 335 | auto it = progressive_id_by_name_.find(prog_name); | ||
| 336 | |||
| 337 | if (it == progressive_id_by_name_.end()) { | ||
| 338 | uint64_t new_id = all_objects_.progressives_size(); | ||
| 339 | Progressive* progressive = all_objects_.add_progressives(); | ||
| 340 | progressive->set_id(new_id); | ||
| 341 | progressive->set_name(prog_name); | ||
| 342 | |||
| 343 | progressive_id_by_name_[prog_name] = new_id; | ||
| 344 | |||
| 345 | return new_id; | ||
| 346 | } else { | ||
| 347 | return it->second; | ||
| 348 | } | ||
| 349 | } | ||
| 350 | |||
| 351 | uint64_t Container::FindOrAddDoorGroup(std::string group_name) { | ||
| 352 | auto it = door_group_id_by_name_.find(group_name); | ||
| 353 | |||
| 354 | if (it == door_group_id_by_name_.end()) { | ||
| 355 | uint64_t new_id = all_objects_.door_groups_size(); | ||
| 356 | DoorGroup* door_group = all_objects_.add_door_groups(); | ||
| 357 | door_group->set_id(new_id); | ||
| 358 | door_group->set_name(group_name); | ||
| 359 | |||
| 360 | door_group_id_by_name_[group_name] = new_id; | ||
| 361 | |||
| 362 | return new_id; | ||
| 363 | } else { | ||
| 364 | return it->second; | ||
| 365 | } | ||
| 366 | } | ||
| 367 | |||
| 318 | void Container::AddConnection(const Connection& connection) { | 368 | void Container::AddConnection(const Connection& connection) { |
| 319 | *all_objects_.add_connections() = connection; | 369 | *all_objects_.add_connections() = connection; |
| 320 | } | 370 | } |
| diff --git a/tools/datapacker/container.h b/tools/datapacker/container.h index e1a84d8..bc02ba4 100644 --- a/tools/datapacker/container.h +++ b/tools/datapacker/container.h | |||
| @@ -40,6 +40,8 @@ class Container { | |||
| 40 | 40 | ||
| 41 | uint64_t FindLetterByName(std::string letter_name); | 41 | uint64_t FindLetterByName(std::string letter_name); |
| 42 | 42 | ||
| 43 | uint64_t FindOrAddEnding(std::string ending_name); | ||
| 44 | |||
| 43 | uint64_t FindOrAddMastery(std::optional<std::string> map_name, | 45 | uint64_t FindOrAddMastery(std::optional<std::string> map_name, |
| 44 | std::optional<std::string> room_name, | 46 | std::optional<std::string> room_name, |
| 45 | std::string mastery_name, | 47 | std::string mastery_name, |
| @@ -58,6 +60,10 @@ class Container { | |||
| 58 | 60 | ||
| 59 | void AddConnection(const Connection& connection); | 61 | void AddConnection(const Connection& connection); |
| 60 | 62 | ||
| 63 | uint64_t FindOrAddProgressive(std::string prog_name); | ||
| 64 | |||
| 65 | uint64_t FindOrAddDoorGroup(std::string group_name); | ||
| 66 | |||
| 61 | AllObjects& all_objects() { return all_objects_; } | 67 | AllObjects& all_objects() { return all_objects_; } |
| 62 | 68 | ||
| 63 | private: | 69 | private: |
| @@ -79,6 +85,9 @@ class Container { | |||
| 79 | keyholder_id_by_map_room_keyholder_names_; | 85 | keyholder_id_by_map_room_keyholder_names_; |
| 80 | std::map<std::string, std::map<std::string, uint64_t>> | 86 | std::map<std::string, std::map<std::string, uint64_t>> |
| 81 | door_id_by_map_door_names_; | 87 | door_id_by_map_door_names_; |
| 88 | std::map<std::string, uint64_t> ending_id_by_name_; | ||
| 89 | std::map<std::string, uint64_t> progressive_id_by_name_; | ||
| 90 | std::map<std::string, uint64_t> door_group_id_by_name_; | ||
| 82 | }; | 91 | }; |
| 83 | 92 | ||
| 84 | } // namespace com::fourisland::lingo2_archipelago | 93 | } // namespace com::fourisland::lingo2_archipelago |
| diff --git a/tools/datapacker/main.cpp b/tools/datapacker/main.cpp index 1736ec1..6bbb461 100644 --- a/tools/datapacker/main.cpp +++ b/tools/datapacker/main.cpp | |||
| @@ -14,6 +14,7 @@ | |||
| 14 | #include "container.h" | 14 | #include "container.h" |
| 15 | #include "proto/data.pb.h" | 15 | #include "proto/data.pb.h" |
| 16 | #include "proto/human.pb.h" | 16 | #include "proto/human.pb.h" |
| 17 | #include "util/ids_yaml_format.h" | ||
| 17 | 18 | ||
| 18 | namespace com::fourisland::lingo2_archipelago { | 19 | namespace com::fourisland::lingo2_archipelago { |
| 19 | namespace { | 20 | namespace { |
| @@ -42,7 +43,10 @@ class DataPacker { | |||
| 42 | 43 | ||
| 43 | ProcessConnectionsFile(datadir_path / "connections.txtpb", std::nullopt); | 44 | ProcessConnectionsFile(datadir_path / "connections.txtpb", std::nullopt); |
| 44 | ProcessMaps(datadir_path); | 45 | ProcessMaps(datadir_path); |
| 45 | ProcessIdsFile(datadir_path / "ids.txtpb"); | 46 | ProcessProgressivesFile(datadir_path / "progressives.txtpb"); |
| 47 | ProcessDoorGroupsFile(datadir_path / "door_groups.txtpb"); | ||
| 48 | ProcessGlobalMetadataFile(datadir_path / "metadata.txtpb"); | ||
| 49 | ProcessIdsFile(datadir_path / "ids.yaml"); | ||
| 46 | 50 | ||
| 47 | { | 51 | { |
| 48 | std::ofstream outputfile(outputpath_); | 52 | std::ofstream outputfile(outputpath_); |
| @@ -65,13 +69,30 @@ class DataPacker { | |||
| 65 | } | 69 | } |
| 66 | 70 | ||
| 67 | void ProcessMap(std::filesystem::path path) { | 71 | void ProcessMap(std::filesystem::path path) { |
| 68 | std::string map_name = path.filename(); | 72 | std::string map_name = path.filename().string(); |
| 69 | 73 | ||
| 74 | ProcessMapMetadataFile(path / "metadata.txtpb", map_name); | ||
| 70 | ProcessConnectionsFile(path / "connections.txtpb", map_name); | 75 | ProcessConnectionsFile(path / "connections.txtpb", map_name); |
| 71 | ProcessDoorsFile(path / "doors.txtpb", map_name); | 76 | ProcessDoorsFile(path / "doors.txtpb", map_name); |
| 72 | ProcessRooms(path / "rooms", map_name); | 77 | ProcessRooms(path / "rooms", map_name); |
| 73 | } | 78 | } |
| 74 | 79 | ||
| 80 | void ProcessMapMetadataFile(std::filesystem::path path, | ||
| 81 | const std::string& map_name) { | ||
| 82 | if (!std::filesystem::exists(path)) { | ||
| 83 | return; | ||
| 84 | } | ||
| 85 | |||
| 86 | auto metadata = ReadMessageFromFile<HumanMap>(path.string()); | ||
| 87 | |||
| 88 | uint64_t map_id = container_.FindOrAddMap(map_name); | ||
| 89 | Map& map = *container_.all_objects().mutable_maps(map_id); | ||
| 90 | |||
| 91 | if (metadata.has_display_name()) { | ||
| 92 | map.set_display_name(metadata.display_name()); | ||
| 93 | } | ||
| 94 | } | ||
| 95 | |||
| 75 | void ProcessRooms(std::filesystem::path path, | 96 | void ProcessRooms(std::filesystem::path path, |
| 76 | const std::string& current_map_name) { | 97 | const std::string& current_map_name) { |
| 77 | for (auto const& dir_entry : std::filesystem::directory_iterator(path)) { | 98 | for (auto const& dir_entry : std::filesystem::directory_iterator(path)) { |
| @@ -86,7 +107,11 @@ class DataPacker { | |||
| 86 | container_.FindOrAddRoom(current_map_name, h_room.name(), std::nullopt); | 107 | container_.FindOrAddRoom(current_map_name, h_room.name(), std::nullopt); |
| 87 | Room& room = *container_.all_objects().mutable_rooms(room_id); | 108 | Room& room = *container_.all_objects().mutable_rooms(room_id); |
| 88 | 109 | ||
| 89 | room.set_display_name(h_room.display_name()); | 110 | // room.set_display_name(h_room.display_name()); |
| 111 | |||
| 112 | if (h_room.has_panel_display_name()) { | ||
| 113 | room.set_panel_display_name(h_room.panel_display_name()); | ||
| 114 | } | ||
| 90 | 115 | ||
| 91 | for (const HumanPanel& h_panel : h_room.panels()) { | 116 | for (const HumanPanel& h_panel : h_room.panels()) { |
| 92 | room.add_panels(ProcessPanel(h_panel, current_map_name, room.name())); | 117 | room.add_panels(ProcessPanel(h_panel, current_map_name, room.name())); |
| @@ -114,6 +139,10 @@ class DataPacker { | |||
| 114 | room.add_keyholders( | 139 | room.add_keyholders( |
| 115 | ProcessKeyholder(h_keyholder, current_map_name, room.name())); | 140 | ProcessKeyholder(h_keyholder, current_map_name, room.name())); |
| 116 | } | 141 | } |
| 142 | |||
| 143 | for (const HumanEnding& h_ending : h_room.endings()) { | ||
| 144 | room.add_endings(ProcessEnding(h_ending, current_map_name, room.name())); | ||
| 145 | } | ||
| 117 | } | 146 | } |
| 118 | 147 | ||
| 119 | uint64_t ProcessPanel(const HumanPanel& h_panel, | 148 | uint64_t ProcessPanel(const HumanPanel& h_panel, |
| @@ -153,6 +182,10 @@ class DataPacker { | |||
| 153 | map_name, h_panel.required_room().name(), current_map_name)); | 182 | map_name, h_panel.required_room().name(), current_map_name)); |
| 154 | } | 183 | } |
| 155 | 184 | ||
| 185 | if (h_panel.has_display_name()) { | ||
| 186 | panel.set_display_name(h_panel.display_name()); | ||
| 187 | } | ||
| 188 | |||
| 156 | return panel_id; | 189 | return panel_id; |
| 157 | } | 190 | } |
| 158 | 191 | ||
| @@ -162,7 +195,7 @@ class DataPacker { | |||
| 162 | uint64_t painting_id = container_.FindOrAddPainting( | 195 | uint64_t painting_id = container_.FindOrAddPainting( |
| 163 | current_map_name, current_room_name, h_painting.name(), std::nullopt, | 196 | current_map_name, current_room_name, h_painting.name(), std::nullopt, |
| 164 | std::nullopt); | 197 | std::nullopt); |
| 165 | Painting& painting = | 198 | PaintingData& painting = |
| 166 | *container_.all_objects().mutable_paintings(painting_id); | 199 | *container_.all_objects().mutable_paintings(painting_id); |
| 167 | 200 | ||
| 168 | painting.set_path(h_painting.path()); | 201 | painting.set_path(h_painting.path()); |
| @@ -257,14 +290,31 @@ class DataPacker { | |||
| 257 | uint64_t keyholder_id = container_.FindOrAddKeyholder( | 290 | uint64_t keyholder_id = container_.FindOrAddKeyholder( |
| 258 | current_map_name, current_room_name, h_keyholder.name(), std::nullopt, | 291 | current_map_name, current_room_name, h_keyholder.name(), std::nullopt, |
| 259 | std::nullopt); | 292 | std::nullopt); |
| 260 | Keyholder& keyholder = | 293 | KeyholderData& keyholder = |
| 261 | *container_.all_objects().mutable_keyholders(keyholder_id); | 294 | *container_.all_objects().mutable_keyholders(keyholder_id); |
| 262 | 295 | ||
| 263 | keyholder.set_path(h_keyholder.path()); | 296 | keyholder.set_path(h_keyholder.path()); |
| 264 | 297 | ||
| 298 | if (h_keyholder.has_key()) { | ||
| 299 | keyholder.set_key(h_keyholder.key()); | ||
| 300 | } | ||
| 301 | |||
| 265 | return keyholder_id; | 302 | return keyholder_id; |
| 266 | } | 303 | } |
| 267 | 304 | ||
| 305 | uint64_t ProcessEnding(const HumanEnding& h_ending, | ||
| 306 | const std::string& current_map_name, | ||
| 307 | const std::string& current_room_name) { | ||
| 308 | uint64_t ending_id = container_.FindOrAddEnding(h_ending.name()); | ||
| 309 | Ending& ending = *container_.all_objects().mutable_endings(ending_id); | ||
| 310 | |||
| 311 | ending.set_room_id(container_.FindOrAddRoom( | ||
| 312 | current_map_name, current_room_name, std::nullopt)); | ||
| 313 | ending.set_path(h_ending.path()); | ||
| 314 | |||
| 315 | return ending_id; | ||
| 316 | } | ||
| 317 | |||
| 268 | void ProcessDoorsFile(std::filesystem::path path, | 318 | void ProcessDoorsFile(std::filesystem::path path, |
| 269 | const std::string& current_map_name) { | 319 | const std::string& current_map_name) { |
| 270 | if (!std::filesystem::exists(path)) { | 320 | if (!std::filesystem::exists(path)) { |
| @@ -295,9 +345,6 @@ class DataPacker { | |||
| 295 | std::copy( | 345 | std::copy( |
| 296 | h_door.receivers().begin(), h_door.receivers().end(), | 346 | h_door.receivers().begin(), h_door.receivers().end(), |
| 297 | google::protobuf::RepeatedFieldBackInserter(door.mutable_receivers())); | 347 | google::protobuf::RepeatedFieldBackInserter(door.mutable_receivers())); |
| 298 | std::copy( | ||
| 299 | h_door.switches().begin(), h_door.switches().end(), | ||
| 300 | google::protobuf::RepeatedFieldBackInserter(door.mutable_switches())); | ||
| 301 | 348 | ||
| 302 | for (const PaintingIdentifier& pi : h_door.move_paintings()) { | 349 | for (const PaintingIdentifier& pi : h_door.move_paintings()) { |
| 303 | std::optional<std::string> map_name = | 350 | std::optional<std::string> map_name = |
| @@ -346,6 +393,10 @@ class DataPacker { | |||
| 346 | container_.FindOrAddDoor(map_name, di.name(), current_map_name)); | 393 | container_.FindOrAddDoor(map_name, di.name(), current_map_name)); |
| 347 | } | 394 | } |
| 348 | 395 | ||
| 396 | for (const std::string& ending_name : h_door.endings()) { | ||
| 397 | door.add_endings(container_.FindOrAddEnding(ending_name)); | ||
| 398 | } | ||
| 399 | |||
| 349 | if (h_door.has_control_center_color()) { | 400 | if (h_door.has_control_center_color()) { |
| 350 | door.set_control_center_color(h_door.control_center_color()); | 401 | door.set_control_center_color(h_door.control_center_color()); |
| 351 | } | 402 | } |
| @@ -355,6 +406,14 @@ class DataPacker { | |||
| 355 | } | 406 | } |
| 356 | 407 | ||
| 357 | door.set_type(h_door.type()); | 408 | door.set_type(h_door.type()); |
| 409 | |||
| 410 | if (h_door.has_location_name()) { | ||
| 411 | door.set_location_name(h_door.location_name()); | ||
| 412 | } | ||
| 413 | |||
| 414 | if (h_door.has_double_letters()) { | ||
| 415 | door.set_double_letters(h_door.double_letters()); | ||
| 416 | } | ||
| 358 | } | 417 | } |
| 359 | 418 | ||
| 360 | void ProcessConnectionsFile(std::filesystem::path path, | 419 | void ProcessConnectionsFile(std::filesystem::path path, |
| @@ -406,6 +465,11 @@ class DataPacker { | |||
| 406 | r_connection.set_required_door(door_id); | 465 | r_connection.set_required_door(door_id); |
| 407 | } | 466 | } |
| 408 | 467 | ||
| 468 | if (human_connection.has_roof_access()) { | ||
| 469 | f_connection.set_roof_access(human_connection.roof_access()); | ||
| 470 | r_connection.set_roof_access(human_connection.roof_access()); | ||
| 471 | } | ||
| 472 | |||
| 409 | container_.AddConnection(f_connection); | 473 | container_.AddConnection(f_connection); |
| 410 | if (!human_connection.oneway()) { | 474 | if (!human_connection.oneway()) { |
| 411 | container_.AddConnection(r_connection); | 475 | container_.AddConnection(r_connection); |
| @@ -489,8 +553,65 @@ class DataPacker { | |||
| 489 | } | 553 | } |
| 490 | } | 554 | } |
| 491 | 555 | ||
| 556 | void ProcessProgressivesFile(std::filesystem::path path) { | ||
| 557 | if (!std::filesystem::exists(path)) { | ||
| 558 | return; | ||
| 559 | } | ||
| 560 | |||
| 561 | auto h_progs = ReadMessageFromFile<HumanProgressives>(path.string()); | ||
| 562 | |||
| 563 | for (const HumanProgressive& h_prog : h_progs.progressives()) { | ||
| 564 | ProcessProgressive(h_prog); | ||
| 565 | } | ||
| 566 | } | ||
| 567 | |||
| 568 | void ProcessProgressive(const HumanProgressive& h_prog) { | ||
| 569 | uint64_t prog_id = container_.FindOrAddProgressive(h_prog.name()); | ||
| 570 | Progressive& prog = *container_.all_objects().mutable_progressives(prog_id); | ||
| 571 | |||
| 572 | for (const DoorIdentifier& di : h_prog.doors()) { | ||
| 573 | uint64_t door_id = | ||
| 574 | container_.FindOrAddDoor(di.map(), di.name(), std::nullopt); | ||
| 575 | prog.add_doors(door_id); | ||
| 576 | } | ||
| 577 | } | ||
| 578 | |||
| 579 | void ProcessDoorGroupsFile(std::filesystem::path path) { | ||
| 580 | if (!std::filesystem::exists(path)) { | ||
| 581 | return; | ||
| 582 | } | ||
| 583 | |||
| 584 | auto h_groups = ReadMessageFromFile<HumanDoorGroups>(path.string()); | ||
| 585 | |||
| 586 | for (const HumanDoorGroup& h_group : h_groups.door_groups()) { | ||
| 587 | ProcessDoorGroup(h_group); | ||
| 588 | } | ||
| 589 | } | ||
| 590 | |||
| 591 | void ProcessDoorGroup(const HumanDoorGroup& h_group) { | ||
| 592 | uint64_t group_id = container_.FindOrAddDoorGroup(h_group.name()); | ||
| 593 | DoorGroup& group = *container_.all_objects().mutable_door_groups(group_id); | ||
| 594 | |||
| 595 | group.set_type(h_group.type()); | ||
| 596 | |||
| 597 | for (const DoorIdentifier& di : h_group.doors()) { | ||
| 598 | uint64_t door_id = | ||
| 599 | container_.FindOrAddDoor(di.map(), di.name(), std::nullopt); | ||
| 600 | group.add_doors(door_id); | ||
| 601 | } | ||
| 602 | } | ||
| 603 | |||
| 604 | void ProcessGlobalMetadataFile(std::filesystem::path path) { | ||
| 605 | if (!std::filesystem::exists(path)) { | ||
| 606 | return; | ||
| 607 | } | ||
| 608 | |||
| 609 | auto h_metadata = ReadMessageFromFile<HumanGlobalMetadata>(path.string()); | ||
| 610 | container_.all_objects().set_version(h_metadata.version()); | ||
| 611 | } | ||
| 612 | |||
| 492 | void ProcessIdsFile(std::filesystem::path path) { | 613 | void ProcessIdsFile(std::filesystem::path path) { |
| 493 | auto ids = ReadMessageFromFile<IdMappings>(path.string()); | 614 | auto ids = ReadIdsFromYaml(path.string()); |
| 494 | 615 | ||
| 495 | for (const auto& [map_name, map] : ids.maps()) { | 616 | for (const auto& [map_name, map] : ids.maps()) { |
| 496 | for (const auto& [door_name, ap_id] : map.doors()) { | 617 | for (const auto& [door_name, ap_id] : map.doors()) { |
| @@ -513,6 +634,14 @@ class DataPacker { | |||
| 513 | .mutable_masteries(mastery_id) | 634 | .mutable_masteries(mastery_id) |
| 514 | ->set_ap_id(ap_id); | 635 | ->set_ap_id(ap_id); |
| 515 | } | 636 | } |
| 637 | |||
| 638 | for (const auto& [keyholder_name, ap_id] : room.keyholders()) { | ||
| 639 | uint64_t keyholder_id = container_.FindOrAddKeyholder( | ||
| 640 | map_name, room_name, keyholder_name, std::nullopt, std::nullopt); | ||
| 641 | container_.all_objects() | ||
| 642 | .mutable_keyholders(keyholder_id) | ||
| 643 | ->set_ap_id(ap_id); | ||
| 644 | } | ||
| 516 | } | 645 | } |
| 517 | } | 646 | } |
| 518 | 647 | ||
| @@ -525,6 +654,21 @@ class DataPacker { | |||
| 525 | uint64_t letter_id = container_.FindLetterByName(letter_name); | 654 | uint64_t letter_id = container_.FindLetterByName(letter_name); |
| 526 | container_.all_objects().mutable_letters(letter_id)->set_ap_id(ap_id); | 655 | container_.all_objects().mutable_letters(letter_id)->set_ap_id(ap_id); |
| 527 | } | 656 | } |
| 657 | |||
| 658 | for (const auto& [ending_name, ap_id] : ids.endings()) { | ||
| 659 | uint64_t ending_id = container_.FindOrAddEnding(ending_name); | ||
| 660 | container_.all_objects().mutable_endings(ending_id)->set_ap_id(ap_id); | ||
| 661 | } | ||
| 662 | |||
| 663 | for (const auto& [prog_name, ap_id] : ids.progressives()) { | ||
| 664 | uint64_t prog_id = container_.FindOrAddProgressive(prog_name); | ||
| 665 | container_.all_objects().mutable_progressives(prog_id)->set_ap_id(ap_id); | ||
| 666 | } | ||
| 667 | |||
| 668 | for (const auto& [group_name, ap_id] : ids.door_groups()) { | ||
| 669 | uint64_t group_id = container_.FindOrAddDoorGroup(group_name); | ||
| 670 | container_.all_objects().mutable_door_groups(group_id)->set_ap_id(ap_id); | ||
| 671 | } | ||
| 528 | } | 672 | } |
| 529 | 673 | ||
| 530 | std::string mapdir_; | 674 | std::string mapdir_; |
