| 187 | } |
| 188 | |
| 189 | static 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 | |
| 211 | static int aquifer_convert(color_ostream &out, string aq_type, |
| 212 | df::coord pos1, df::coord pos2, int skip_top, int levels, bool leaky) |
nothing calls this directly
no test coverage detected