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

Function regrass_cuboid

plugins/regrass.cpp:386–402  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

384}
385
386int regrass_cuboid(color_ostream &out, const regrass_options &options, const cuboid &bounds)
387{ // Regrass all tiles in the defined cuboid.
388 DEBUG(log, out).print("Regrassing cuboid ({}:{}, {}:{}, {}:{})\n",
389 bounds.x_min, bounds.x_max, bounds.y_min, bounds.y_max, bounds.z_min, bounds.z_max);
390
391 int count = 0;
392 bounds.forBlock([&](df::map_block *block, cuboid intersect) {
393 DEBUG(log, out).print("Cuboid regrass block at ({}, {}, {})\n",
394 block->map_pos.x, block->map_pos.y, block->map_pos.z);
395 intersect.forCoord([&](df::coord pos) {
396 count += regrass_tile(out, options, block, pos.x&15, pos.y&15);
397 return true;
398 });
399 return true;
400 });
401 return count;
402}
403
404int regrass_block(color_ostream &out, const regrass_options &options, df::map_block *block)
405{ // Regrass all tiles in a single block.

Callers 1

df_regrassFunction · 0.85

Calls 4

regrass_tileFunction · 0.85
forBlockMethod · 0.80
forCoordMethod · 0.80
printMethod · 0.45

Tested by

no test coverage detected