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

Function aquifer_drain

plugins/aquifer.cpp:189–209  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

187}
188
189static int aquifer_drain(color_ostream &out, string aq_type,
190 df::coord pos1, df::coord pos2, int skip_top, int levels, bool leaky)
191{
192 DEBUG(log,out).print("entering aquifer_drain: aq_type={}, pos1={}, pos2={}, skip_top={}, levels={}, leaky={}\n",
193 aq_type, pos1, pos2, skip_top, levels, leaky);
194
195 const bool all = aq_type == "all";
196 const bool heavy_state = aq_type == "heavy";
197
198 int modified = Maps::removeAreaAquifer(pos1, pos2, [&](df::coord pos, df::map_block* block) -> bool {
199 TRACE(log, out).print("examining tile: pos={}\n", pos);
200 return Maps::isTileAquifer(pos)
201 && (all || Maps::isTileHeavyAquifer(pos) == heavy_state)
202 && (!leaky || is_leaky(pos));
203 });
204
205 DEBUG(log, out).print("drained aquifer tiles in area: pos1={}, pos2={}, heavy_state={}, all={}, count={}\n",
206 pos1, pos2, heavy_state, all, modified);
207
208 return modified;
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)

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