MCPcopy Index your code
hub / github.com/battlecode/battlecode-2018 / subtract

Method subtract

battlecode-engine/src/location.rs:170–176  ·  view source on GitHub ↗

Returns the location one square from this one in the opposite direction.

(&self, direction: Direction)

Source from the content-addressed store, hash-verified

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.

Callers

nothing calls this directly

Calls 2

dxMethod · 0.80
dyMethod · 0.80

Tested by

no test coverage detected