From bdffc8fe5dda6aa553017cd5bdbccafced225a55 Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Thu, 7 Aug 2025 21:35:25 -0400 Subject: Added special IDs --- data/ids.txtpb | 104 ++++++++++++++++++++++++++++++++++++++++++++++ proto/data.proto | 1 + proto/human.proto | 1 + tools/assign_ids/main.cpp | 8 ++++ tools/datapacker/main.cpp | 5 +++ 5 files changed, 119 insertions(+) diff --git a/data/ids.txtpb b/data/ids.txtpb index d6ad423..423f503 100644 --- a/data/ids.txtpb +++ b/data/ids.txtpb @@ -529,3 +529,107 @@ maps { } } } +special { + key: "A" + value: 105 +} +special { + key: "B" + value: 106 +} +special { + key: "C" + value: 107 +} +special { + key: "D" + value: 108 +} +special { + key: "E" + value: 109 +} +special { + key: "F" + value: 110 +} +special { + key: "G" + value: 111 +} +special { + key: "H" + value: 112 +} +special { + key: "I" + value: 113 +} +special { + key: "J" + value: 114 +} +special { + key: "K" + value: 115 +} +special { + key: "L" + value: 116 +} +special { + key: "M" + value: 117 +} +special { + key: "N" + value: 118 +} +special { + key: "O" + value: 119 +} +special { + key: "P" + value: 120 +} +special { + key: "Q" + value: 121 +} +special { + key: "R" + value: 122 +} +special { + key: "S" + value: 123 +} +special { + key: "T" + value: 124 +} +special { + key: "U" + value: 125 +} +special { + key: "V" + value: 126 +} +special { + key: "W" + value: 127 +} +special { + key: "X" + value: 128 +} +special { + key: "Y" + value: 129 +} +special { + key: "Z" + value: 130 +} diff --git a/proto/data.proto b/proto/data.proto index bea2563..3737934 100644 --- a/proto/data.proto +++ b/proto/data.proto @@ -107,4 +107,5 @@ message AllObjects { repeated Painting paintings = 4; repeated Port ports = 5; repeated Connection connections = 6; + map special_ids = 8; } diff --git a/proto/human.proto b/proto/human.proto index 1dcf2ab..c0a5e85 100644 --- a/proto/human.proto +++ b/proto/human.proto @@ -136,4 +136,5 @@ message IdMappings { } map maps = 1; + map special = 2; } diff --git a/tools/assign_ids/main.cpp b/tools/assign_ids/main.cpp index 1824c6f..39b532a 100644 --- a/tools/assign_ids/main.cpp +++ b/tools/assign_ids/main.cpp @@ -40,6 +40,8 @@ class AssignIds { ProcessMaps(datadir_path); WriteIds(ids_path); + + std::cout << "Next ID: " << next_id_ << std::endl; } void ReadIds(std::filesystem::path path) { @@ -61,6 +63,12 @@ class AssignIds { } } + for (const auto& [_, id] : id_mappings_.special()) { + if (id > next_id_) { + next_id_ = id; + } + } + next_id_++; } diff --git a/tools/datapacker/main.cpp b/tools/datapacker/main.cpp index 4b26141..92ff151 100644 --- a/tools/datapacker/main.cpp +++ b/tools/datapacker/main.cpp @@ -408,6 +408,11 @@ class DataPacker { } } } + + auto& specials = *container_.all_objects().mutable_special_ids(); + for (const auto& [tag, id] : ids.special()) { + specials[tag] = id; + } } std::string mapdir_; -- cgit 1.4.1