| 281 | */ |
| 282 | |
| 283 | static void find_reagent( |
| 284 | color_ostream &out, ReagentSource &info, df::reaction *react, std::string name |
| 285 | ) { |
| 286 | for (size_t i = 0; i < react->reagents.size(); i++) |
| 287 | { |
| 288 | if (react->reagents[i]->code != name) |
| 289 | continue; |
| 290 | |
| 291 | info.idx = i; |
| 292 | info.reagent = react->reagents[i]; |
| 293 | return; |
| 294 | } |
| 295 | |
| 296 | out.printerr("Invalid reagent name '{}' in '{}'\n", name, react->code); |
| 297 | } |
| 298 | |
| 299 | static void parse_product( |
| 300 | color_ostream &out, ProductInfo &info, df::reaction *react, improvement_product *prod |