MCPcopy Create free account
hub / github.com/battlecode/battlecode-2018 / can_javelin

Method can_javelin

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

Whether the knight can javelin the given robot, without taking into account the knight's ability heat. Takes into account only the knight's ability range, and the location of the robot.

(&self, knight_id: UnitID, target_id: UnitID)

Source from the content-addressed store, hash-verified

1482 /// account the knight's ability heat. Takes into account only the knight's
1483 /// ability range, and the location of the robot.
1484 pub fn can_javelin(&self, knight_id: UnitID, target_id: UnitID) -> bool {
1485 self.ok_if_can_javelin(knight_id, target_id).is_ok()
1486 }
1487
1488 fn ok_if_javelin_ready(&self, knight_id: UnitID) -> Result<(), GameError> {
1489 let knight = self.my_unit(knight_id)?;

Callers

nothing calls this directly

Calls 1

ok_if_can_javelinMethod · 0.80

Tested by

no test coverage detected