------------------------------------------------ GET UNITS IN RADIUS -------------------------------------
| 16 | { |
| 17 | //------------------------------------------------ GET UNITS IN RADIUS ------------------------------------- |
| 18 | Unitset UnitInterface::getUnitsInRadius(int radius, const UnitFilter &pred) const |
| 19 | { |
| 20 | // Return if this unit does not exist |
| 21 | if ( !this->exists() ) |
| 22 | return Unitset::none; |
| 23 | |
| 24 | return Broodwar->getUnitsInRectangle(this->getLeft() - radius, |
| 25 | this->getTop() - radius, |
| 26 | this->getRight() + radius, |
| 27 | this->getBottom() + radius, |
| 28 | [&](Unit u){ return this != u && this->getDistance(u) <= radius && (!pred.isValid() || pred(u)); }); |
| 29 | } |
| 30 | |
| 31 | Unit UnitInterface::getClosestUnit(const UnitFilter &pred, int radius) const |
| 32 | { |
nothing calls this directly
no test coverage detected