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

Function aquifer_convert

plugins/aquifer.cpp:211–230  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

209}
210
211static int aquifer_convert(color_ostream &out, string aq_type,
212 df::coord pos1, df::coord pos2, int skip_top, int levels, bool leaky)
213{
214 DEBUG(log,out).print("entering aquifer_convert: aq_type={}, pos1={}, pos2={}, skip_top={}, levels={}, leaky={}\n",
215 aq_type, pos1, pos2, skip_top, levels, leaky);
216
217 const bool heavy_state = aq_type == "heavy";
218
219 int modified = Maps::setAreaAquifer(pos1, pos2, heavy_state, [&](df::coord pos, df::map_block* block) -> bool {
220 TRACE(log, out).print("examining tile: pos={}\n", pos);
221 return Maps::isTileAquifer(pos)
222 && Maps::isTileHeavyAquifer(pos) != heavy_state
223 && (!leaky || is_leaky(pos));
224 });
225
226 DEBUG(log, out).print("converted aquifer tiles in area: pos1={}, pos2={}, heavy_state={}, count={}\n",
227 pos1, pos2, heavy_state, modified);
228
229 return modified;
230}
231
232static int aquifer_add(color_ostream &out, string aq_type,
233 df::coord pos1, df::coord pos2, int skip_top, int levels, bool leaky)

Callers

nothing calls this directly

Calls 4

isTileAquiferFunction · 0.85
isTileHeavyAquiferFunction · 0.85
is_leakyFunction · 0.85
printMethod · 0.45

Tested by

no test coverage detected