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

Method read_finished_goods

plugins/stockpiles/StockpileSerializer.cpp:1544–1591  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1542}
1543
1544void StockpileSettingsSerializer::read_finished_goods(color_ostream& out, DeserializeMode mode, const vector<string>& filters) {
1545 auto & pfinished_goods = mSettings->finished_goods;
1546 read_category<StockpileSettings_FinishedGoodsSet>(out, "finished_goods", mode,
1547 std::bind(&StockpileSettings::has_finished_goods, mBuffer),
1548 std::bind(&StockpileSettings::finished_goods, mBuffer),
1549 mSettings->flags.whole,
1550 mSettings->flags.mask_finished_goods,
1551 [&]() {
1552 pfinished_goods.type.clear();
1553 pfinished_goods.other_mats.clear();
1554 pfinished_goods.mats.clear();
1555 quality_clear(pfinished_goods.quality_core);
1556 quality_clear(pfinished_goods.quality_total);
1557 pfinished_goods.dyed = false;
1558 pfinished_goods.undyed = false;
1559 pfinished_goods.color.clear();
1560 },
1561 [&](bool all, char val) {
1562 auto & bfinished_goods = mBuffer.finished_goods();
1563
1564 unserialize_list_item_type(out, "type", all, val, filters, finished_goods_type_is_allowed,
1565 [&](const size_t& idx) -> const string& { return bfinished_goods.type(idx); },
1566 bfinished_goods.type_size(), pfinished_goods.type);
1567
1568 unserialize_list_material(out, "mats", all, val, filters, finished_goods_mat_is_allowed,
1569 [&](const size_t& idx) -> const string& { return bfinished_goods.mats(idx); },
1570 bfinished_goods.mats_size(), pfinished_goods.mats);
1571
1572 unserialize_list_other_mats(out, "other", all, val, filters, mOtherMatsFinishedGoods.mats,
1573 [&](const size_t& idx) -> const string& { return bfinished_goods.other_mats(idx); },
1574 bfinished_goods.other_mats_size(), pfinished_goods.other_mats);
1575
1576 unserialize_list_quality(out, "core", all, val, filters,
1577 [&](const size_t& idx) -> const string& { return bfinished_goods.quality_core(idx); },
1578 bfinished_goods.quality_core_size(), pfinished_goods.quality_core);
1579
1580 unserialize_list_quality(out, "total", all, val, filters,
1581 [&](const size_t& idx) -> const string& { return bfinished_goods.quality_total(idx); },
1582 bfinished_goods.quality_total_size(), pfinished_goods.quality_total);
1583
1584 unserialize_list_color(out, "color", all, val, filters,
1585 [&](const size_t& idx) -> const string& { return bfinished_goods.color(idx); },
1586 bfinished_goods.color_size(), pfinished_goods.color);
1587
1588 set_flag(out, "dyed", filters, all, val, bfinished_goods.dyed(), pfinished_goods.dyed);
1589 set_flag(out, "undyed", filters, all, val, bfinished_goods.undyed(), pfinished_goods.undyed);
1590 });
1591}
1592
1593food_pair StockpileSettingsSerializer::food_map(organic_mat_category::organic_mat_category cat) {
1594 using df::enums::organic_mat_category::organic_mat_category;

Callers

nothing calls this directly

Calls 10

quality_clearFunction · 0.85
unserialize_list_qualityFunction · 0.85
unserialize_list_colorFunction · 0.85
set_flagFunction · 0.85
clearMethod · 0.45
typeMethod · 0.45
colorMethod · 0.45

Tested by

no test coverage detected