Returns the location one square from this one in the opposite direction.
(&self, direction: Direction)
| 168 | |
| 169 | /// Returns the location one square from this one in the opposite direction. |
| 170 | pub fn subtract(&self, direction: Direction) -> MapLocation { |
| 171 | MapLocation { |
| 172 | planet: self.planet, |
| 173 | x: self.x - direction.dx(), |
| 174 | y: self.y - direction.dy(), |
| 175 | } |
| 176 | } |
| 177 | |
| 178 | /// Returns the location `multiple` squares from this one in the given |
| 179 | /// direction. |