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

Function set_range

plugins/siege-engine.cpp:155–170  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

153typedef std::pair<df::coord, df::coord> coord_range;
154
155static void set_range(coord_range *target, df::coord p1, df::coord p2)
156{
157 if (!p1.isValid() || !p2.isValid())
158 {
159 *target = coord_range();
160 }
161 else
162 {
163 target->first.x = std::min(p1.x, p2.x);
164 target->first.y = std::min(p1.y, p2.y);
165 target->first.z = std::min(p1.z, p2.z);
166 target->second.x = std::max(p1.x, p2.x);
167 target->second.y = std::max(p1.y, p2.y);
168 target->second.z = std::max(p1.z, p2.z);
169 }
170}
171
172static bool is_range_valid(const coord_range &target)
173{

Callers 1

setTargetAreaFunction · 0.85

Calls 1

isValidMethod · 0.45

Tested by

no test coverage detected