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

Method addPos

library/modules/Maps.cpp:181–196  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

179}
180
181bool cuboid::addPos(int16_t x, int16_t y, int16_t z)
182{
183 if (x < 0 || y < 0 || z < 0 || (isValid() && containsPos(x, y, z)))
184 return false;
185
186 x_min = (x_min < 0 || x < x_min) ? x : x_min;
187 x_max = (x_max < 0 || x > x_max) ? x : x_max;
188
189 y_min = (y_min < 0 || y < y_min) ? y : y_min;
190 y_max = (y_max < 0 || y > y_max) ? y : y_max;
191
192 z_min = (z_min < 0 || z < z_min) ? z : z_min;
193 z_max = (z_max < 0 || z > z_max) ? z : z_max;
194
195 return true;
196}
197
198bool cuboid::containsPos(int16_t x, int16_t y, int16_t z) const {
199 return x >= x_min && y >= y_min && z >= z_min &&

Callers 1

df_plantFunction · 0.45

Calls 1

isValidFunction · 0.50

Tested by

no test coverage detected