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

Method can_move

battlecode-engine/src/world.rs:1010–1012  ·  view source on GitHub ↗

Whether the robot can move in the given direction, without taking into account the unit's movement heat. Takes into account only the map terrain, positions of other robots, and the edge of the game map.

(&self, robot_id: UnitID, direction: Direction)

Source from the content-addressed store, hash-verified

1008 /// account the unit's movement heat. Takes into account only the map
1009 /// terrain, positions of other robots, and the edge of the game map.
1010 pub fn can_move(&self, robot_id: UnitID, direction: Direction) -> bool {
1011 self.ok_if_can_move(robot_id, direction).is_ok()
1012 }
1013
1014 /// * NoSuchUnit - the unit does not exist (inside the vision range).
1015 /// * TeamNotAllowed - the unit is not on the current player's team.

Callers 3

run.pyFile · 0.45
run.pyFile · 0.45
examplefuncsplayerFunction · 0.45

Calls 1

ok_if_can_moveMethod · 0.80

Tested by

no test coverage detected