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

Function printVeins

plugins/prospector.cpp:219–259  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

217}
218
219void printVeins(color_ostream &con, MatMap &mat_map,
220 const prospect_options &options)
221{
222 MatMap ores;
223 MatMap gems;
224 MatMap rest;
225
226 auto & inorganics = world->raws.inorganics.all;
227
228 for (const auto &kv : mat_map)
229 {
230 df::inorganic_raw *gloss = vector_get(inorganics, kv.first);
231 if (!gloss)
232 {
233 con.printerr("invalid material gloss: {}\n", kv.first);
234 continue;
235 }
236
237 if (gloss->material.isGem())
238 gems[kv.first] = kv.second;
239 else if (gloss->isOre())
240 ores[kv.first] = kv.second;
241 else
242 rest[kv.first] = kv.second;
243 }
244
245 if (options.ores) {
246 con << "Ores:" << std::endl;
247 printMats<df::inorganic_raw, std::greater>(con, ores, inorganics, options);
248 }
249
250 if (options.gems) {
251 con << "Gems:" << std::endl;
252 printMats<df::inorganic_raw, std::greater>(con, gems, inorganics, options);
253 }
254
255 if (options.veins) {
256 con << "Other vein stone:" << std::endl;
257 printMats<df::inorganic_raw, std::greater>(con, rest, inorganics, options);
258 }
259}
260
261command_result prospector (color_ostream &out, vector <string> & parameters);
262

Callers 2

embark_prospectorFunction · 0.85
map_prospectorFunction · 0.85

Calls 3

vector_getFunction · 0.85
isGemMethod · 0.80
isOreMethod · 0.80

Tested by

no test coverage detected