MCPcopy Create free account
hub / github.com/DFHack/dfhack / load_noble_map

Function load_noble_map

plugins/preserve-rooms.cpp:203–219  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

201}
202
203static void load_noble_map(unordered_map<int32_t, vector<string>> * data, const char * suffix) {
204 PersistentDataItem c = get_config(suffix);
205 if (!c.isValid())
206 return;
207
208 vector<string> elems;
209 split_string(&elems, c.get_str(), ",");
210 for (auto elem : elems) {
211 vector<string> key_and_codes;
212 split_string(&key_and_codes, elem, "/");
213 if (key_and_codes.size() < 2)
214 continue;
215 int32_t key = string_to_int(key_and_codes[0], -1);
216 key_and_codes.erase(key_and_codes.begin());
217 data->emplace(key, key_and_codes);
218 }
219}
220
221DFhackCExport command_result plugin_load_site_data(color_ostream &out) {
222 cycle_timestamp = 0;

Callers 1

Calls 7

get_configFunction · 0.85
split_stringFunction · 0.85
string_to_intFunction · 0.85
isValidMethod · 0.45
sizeMethod · 0.45
eraseMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected