Whether this location is within the distance squared range of the specified location, inclusive. False for locations on different planets.
(&self, range: u32, o: MapLocation)
| 271 | /// Whether this location is within the distance squared range of the |
| 272 | /// specified location, inclusive. False for locations on different planets. |
| 273 | pub fn is_within_range(&self, range: u32, o: MapLocation) -> bool { |
| 274 | if self.planet != o.planet { |
| 275 | return false; |
| 276 | } |
| 277 | range >= self.distance_squared_to(o) |
| 278 | } |
| 279 | } |
| 280 | |
| 281 | /// Any location in the Battlecode world. |
no test coverage detected