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

Function around

plugins/suspendmanager.cpp:205–207  ·  view source on GitHub ↗

allows the idiom: "for (auto npos : neighbors | transform(around(pos)))"

Source from the content-addressed store, hash-verified

203// allows the idiom:
204// "for (auto npos : neighbors | transform(around(pos)))"
205static std::function<coord(offset)> around (coord pos) {
206 return [pos](offset o){ return pos + o; };
207}
208
209/* offsets for various neighborhoods
210 * using constexpr would be preferable,

Callers 5

hasWalkableNeighborMethod · 0.85
riskBlockingMethod · 0.85
suspendDeadendMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected