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

Method read_stone

plugins/stockpiles/StockpileSerializer.cpp:2260–2277  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2258}
2259
2260void 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
2279static 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));

Callers

nothing calls this directly

Calls 2

clearMethod · 0.45

Tested by

no test coverage detected