| 2258 | } |
| 2259 | |
| 2260 | void StockpileSettingsSerializer::read_stone(color_ostream& out, DeserializeMode mode, const vector<string>& filters) { |
| 2261 | auto & pstone = mSettings->stone; |
| 2262 | read_category<StockpileSettings_StoneSet>(out, "stone", mode, |
| 2263 | std::bind(&StockpileSettings::has_stone, mBuffer), |
| 2264 | std::bind(&StockpileSettings::stone, mBuffer), |
| 2265 | mSettings->flags.whole, |
| 2266 | mSettings->flags.mask_stone, |
| 2267 | [&]() { |
| 2268 | pstone.mats.clear(); |
| 2269 | }, |
| 2270 | [&](bool all, char val) { |
| 2271 | auto & bstone = mBuffer.stone(); |
| 2272 | |
| 2273 | unserialize_list_material(out, "", all, val, filters, stone_is_allowed, |
| 2274 | [&](const size_t& idx) -> const string& { return bstone.mats(idx); }, |
| 2275 | bstone.mats_size(), pstone.mats); |
| 2276 | }); |
| 2277 | } |
| 2278 | |
| 2279 | static bool weapons_mat_is_allowed(const MaterialInfo& mi) { |
| 2280 | return mi.isValid() && mi.material && (mi.material->flags.is_set(material_flags::IS_METAL) || mi.material->flags.is_set(material_flags::IS_STONE)); |
nothing calls this directly
no test coverage detected