Computes the square of the distance from this location to the specified location. If on different planets, returns the maximum integer.
(&self, o: MapLocation)
| 199 | /// Computes the square of the distance from this location to the specified |
| 200 | /// location. If on different planets, returns the maximum integer. |
| 201 | pub fn distance_squared_to(&self, o: MapLocation) -> u32 { |
| 202 | if self.planet == o.planet { |
| 203 | ((self.x - o.x) * (self.x - o.x) + (self.y - o.y) * (self.y - o.y)) as u32 |
| 204 | } else { |
| 205 | u32::max_value() |
| 206 | } |
| 207 | } |
| 208 | |
| 209 | /// Returns the Direction from this location to the specified location. |
| 210 | /// If the locations are equal this method returns Center. |
no outgoing calls
no test coverage detected