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

Method getUnitsInBox

library/modules/Units.cpp:677–686  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

675}
676
677bool Units::getUnitsInBox(vector<df::unit *> &units, const cuboid &box, std::function<bool(df::unit *)> filter) {
678 if (!world)
679 return false;
680
681 units.clear();
682 for (auto unit : world->units.active)
683 if (isUnitInBox(unit, box) && filter(unit))
684 units.push_back(unit);
685 return true;
686}
687
688static int32_t get_noble_position_id(const df::historical_entity::T_positions &positions, const string &noble) {
689 string target_id = toUpper_cp437(noble);

Callers

nothing calls this directly

Calls 3

isUnitInBoxFunction · 0.85
filterFunction · 0.85
clearMethod · 0.45

Tested by

no test coverage detected