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

Function parse_product

plugins/add-spatter.cpp:299–327  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

297}
298
299static void parse_product(
300 color_ostream &out, ProductInfo &info, df::reaction *react, improvement_product *prod
301) {
302 using namespace df::enums::reaction_product_improvement_flags;
303
304 info.react = react;
305 info.product = prod;
306
307 find_reagent(out, info.object, react, prod->target_reagent);
308
309 auto ritem = strict_virtual_cast<df::reaction_reagent_itemst>(info.object.reagent);
310 if (ritem)
311 ritem->flags1.bits.improvable = true;
312
313 info.material.mat_type = prod->mat_type;
314 info.material.mat_index = prod->mat_index;
315
316 if (prod->flags.is_set(GET_MATERIAL_PRODUCT))
317 {
318 find_reagent(out, info.material, react, prod->get_material.reagent_code);
319
320 info.material.product = true;
321 info.material.product_name = prod->get_material.product_code;
322 }
323 else if (prod->flags.is_set(GET_MATERIAL_SAME))
324 {
325 find_reagent(out, info.material, react, prod->get_material.reagent_code);
326 }
327}
328
329static bool find_reactions(color_ostream &out)
330{

Callers 1

find_reactionsFunction · 0.70

Calls 2

find_reagentFunction · 0.85
is_setMethod · 0.80

Tested by

no test coverage detected