| 198 | DFHACK_EXPORT df::unit *getUnitByNobleRole(std::string noble); |
| 199 | |
| 200 | inline auto citizensRange(std::vector<df::unit *> &vec, bool exclude_residents = false, bool include_insane = false) { |
| 201 | return vec | std::views::filter([=](df::unit *unit) { |
| 202 | if (isDead(unit) || !isActive(unit)) |
| 203 | return false; |
| 204 | return isCitizen(unit, include_insane) || |
| 205 | (!exclude_residents && isResident(unit, include_insane)); |
| 206 | }); |
| 207 | } |
| 208 | |
| 209 | DFHACK_EXPORT void forCitizens(std::function<void(df::unit *)> fn, bool exclude_residents = false, bool include_insane = false); |
| 210 | DFHACK_EXPORT bool getCitizens(std::vector<df::unit *> &citizens, bool exclude_residents = false, bool include_insane = false); |
no test coverage detected