| 217 | } |
| 218 | |
| 219 | void 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 | |
| 261 | command_result prospector (color_ostream &out, vector <string> & parameters); |
| 262 |
no test coverage detected