| 1296 | } |
| 1297 | |
| 1298 | void StockpileSettingsSerializer::read_bars_blocks(color_ostream& out, DeserializeMode mode, const vector<string>& filters) { |
| 1299 | auto & pbarsblocks = mSettings->bars_blocks; |
| 1300 | read_category<StockpileSettings_BarsBlocksSet>(out, "bars_blocks", mode, |
| 1301 | std::bind(&StockpileSettings::has_barsblocks, mBuffer), |
| 1302 | std::bind(&StockpileSettings::barsblocks, mBuffer), |
| 1303 | mSettings->flags.whole, |
| 1304 | mSettings->flags.mask_bars_blocks, |
| 1305 | [&]() { |
| 1306 | pbarsblocks.bars_mats.clear(); |
| 1307 | pbarsblocks.bars_other_mats.clear(); |
| 1308 | pbarsblocks.blocks_mats.clear(); |
| 1309 | pbarsblocks.blocks_other_mats.clear(); |
| 1310 | }, |
| 1311 | [&](bool all, char val) { |
| 1312 | auto & bbarsblocks = mBuffer.barsblocks(); |
| 1313 | |
| 1314 | unserialize_list_material(out, "mats/bars", all, val, filters, bars_mat_is_allowed, |
| 1315 | [&](const size_t& idx) -> const string& { return bbarsblocks.bars_mats(idx); }, |
| 1316 | bbarsblocks.bars_mats_size(), pbarsblocks.bars_mats); |
| 1317 | |
| 1318 | unserialize_list_other_mats(out, "other/bars", all, val, filters, |
| 1319 | mOtherMatsBars.mats, |
| 1320 | [&](const size_t& idx) -> const string& { return bbarsblocks.bars_other_mats(idx); }, |
| 1321 | bbarsblocks.bars_other_mats_size(), pbarsblocks.bars_other_mats); |
| 1322 | |
| 1323 | unserialize_list_material(out, "mats/blocks", all, val, filters, |
| 1324 | blocks_mat_is_allowed, |
| 1325 | [&](const size_t& idx) -> const string& { return bbarsblocks.blocks_mats(idx); }, |
| 1326 | bbarsblocks.blocks_mats_size(), pbarsblocks.blocks_mats); |
| 1327 | |
| 1328 | unserialize_list_other_mats(out, "other/blocks", all, val, filters, |
| 1329 | mOtherMatsBlocks.mats, |
| 1330 | [&](const size_t& idx) -> const string& { return bbarsblocks.blocks_other_mats(idx); }, |
| 1331 | bbarsblocks.blocks_other_mats_size(), pbarsblocks.blocks_other_mats); |
| 1332 | }); |
| 1333 | } |
| 1334 | |
| 1335 | bool StockpileSettingsSerializer::write_cloth(color_ostream& out, StockpileSettings::ClothSet* cloth) { |
| 1336 | bool all = mSettings->cloth.dyed && mSettings->cloth.undyed; |
nothing calls this directly
no test coverage detected