| 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) |
| 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 | |
| 232 | static int aquifer_add(color_ostream &out, string aq_type, |
| 233 | df::coord pos1, df::coord pos2, int skip_top, int levels, bool leaky) |
nothing calls this directly
no test coverage detected