MCPcopy Create free account
hub / github.com/bwapi/bwapi / getUnitsInRadius

Method getUnitsInRadius

bwapi/BWAPILIB/Source/Game.cpp:701–708  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

699 return this->getUnitsInRectangle(p.x, p.y, p.x + 32, p.y + 32, pred);
700 }
701 Unitset Game::getUnitsInRadius(int x, int y, int radius, const UnitFilter &pred) const
702 {
703 return this->getUnitsInRectangle(x - radius,
704 y - radius,
705 x + radius,
706 y + radius,
707 [&x,&y,&radius,&pred](Unit u){ return u->getDistance(Position(x,y)) <= radius && (!pred.isValid() || pred(u)); });
708 }
709 Unitset Game::getUnitsInRadius(Position center, int radius, const UnitFilter &pred) const
710 {
711 return this->getUnitsInRadius(center.x, center.y, radius, pred);

Callers

nothing calls this directly

Calls 4

getUnitsInRectangleMethod · 0.95
PositionClass · 0.50
getDistanceMethod · 0.45
isValidMethod · 0.45

Tested by

no test coverage detected