Returns the location one square from this one in the given direction.
(&self, direction: Direction)
| 159 | |
| 160 | /// Returns the location one square from this one in the given direction. |
| 161 | pub fn add(&self, direction: Direction) -> MapLocation { |
| 162 | MapLocation { |
| 163 | planet: self.planet, |
| 164 | x: self.x + direction.dx(), |
| 165 | y: self.y + direction.dy(), |
| 166 | } |
| 167 | } |
| 168 | |
| 169 | /// Returns the location one square from this one in the opposite direction. |
| 170 | pub fn subtract(&self, direction: Direction) -> MapLocation { |