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

Method clamp

library/modules/Maps.cpp:149–163  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

147}
148
149cuboid cuboid::clamp(const cuboid &other)
150{
151 if (isValid() && other.isValid()) {
152 x_min = max(x_min, other.x_min);
153 y_min = max(y_min, other.y_min);
154 z_min = max(z_min, other.z_min);
155 x_max = min(x_max, other.x_max);
156 y_max = min(y_max, other.y_max);
157 z_max = min(z_max, other.z_max);
158 }
159 else
160 clear();
161
162 return *this;
163}
164
165cuboid cuboid::clampMap(bool block)
166{

Callers 3

forBlockMethod · 0.80
clampNewMethod · 0.80
plant_in_cuboidFunction · 0.80

Calls 3

isValidFunction · 0.50
clearFunction · 0.50
isValidMethod · 0.45

Tested by

no test coverage detected