diff options
author | Star Rauchenberger <fefferburbia@gmail.com> | 2025-08-20 15:03:18 -0400 |
---|---|---|
committer | Star Rauchenberger <fefferburbia@gmail.com> | 2025-08-20 15:03:18 -0400 |
commit | d77c73397b684faa55f0e95484ac89ca68bde1ad (patch) | |
tree | 84fd35d342b69a9765d8f94473b56998d26e323d /tools/util | |
parent | 53ad8e2f3e5fcf9cf9d5d4628498557e0f5500e8 (diff) | |
download | lingo2-archipelago-d77c73397b684faa55f0e95484ac89ca68bde1ad.tar.gz lingo2-archipelago-d77c73397b684faa55f0e95484ac89ca68bde1ad.tar.bz2 lingo2-archipelago-d77c73397b684faa55f0e95484ac89ca68bde1ad.zip |
Added "endings" object type
Diffstat (limited to 'tools/util')
-rw-r--r-- | tools/util/ids_yaml_format.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tools/util/ids_yaml_format.cpp b/tools/util/ids_yaml_format.cpp index 99a8890..f72f60e 100644 --- a/tools/util/ids_yaml_format.cpp +++ b/tools/util/ids_yaml_format.cpp | |||
@@ -75,6 +75,13 @@ IdMappings ReadIdsFromYaml(const std::string& filename) { | |||
75 | } | 75 | } |
76 | } | 76 | } |
77 | 77 | ||
78 | if (document["endings"]) { | ||
79 | for (const auto& ending_it : document["endings"]) { | ||
80 | (*result.mutable_endings())[ending_it.first.as<std::string>()] = | ||
81 | ending_it.second.as<uint64_t>(); | ||
82 | } | ||
83 | } | ||
84 | |||
78 | if (document["special"]) { | 85 | if (document["special"]) { |
79 | for (const auto& special_it : document["special"]) { | 86 | for (const auto& special_it : document["special"]) { |
80 | (*result.mutable_special())[special_it.first.as<std::string>()] = | 87 | (*result.mutable_special())[special_it.first.as<std::string>()] = |
@@ -127,6 +134,11 @@ void WriteIdsAsYaml(const IdMappings& ids, const std::string& filename) { | |||
127 | result["letters"][letter_name] = letter_id; | 134 | result["letters"][letter_name] = letter_id; |
128 | }); | 135 | }); |
129 | 136 | ||
137 | OperateOnSortedMap(ids.endings(), [&result](const std::string& ending_name, | ||
138 | uint64_t ending_id) { | ||
139 | result["endings"][ending_name] = ending_id; | ||
140 | }); | ||
141 | |||
130 | OperateOnSortedMap(ids.special(), [&result](const std::string& special_name, | 142 | OperateOnSortedMap(ids.special(), [&result](const std::string& special_name, |
131 | uint64_t special_id) { | 143 | uint64_t special_id) { |
132 | result["special"][special_name] = special_id; | 144 | result["special"][special_name] = special_id; |