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

Method ok_if_can_javelin

battlecode-engine/src/world.rs:1472–1479  ·  view source on GitHub ↗
(&self, knight_id: UnitID, target_id: UnitID)

Source from the content-addressed store, hash-verified

1470 // ************************************************************************
1471
1472 fn ok_if_can_javelin(&self, knight_id: UnitID, target_id: UnitID) -> Result<(), GameError> {
1473 let knight = self.my_unit(knight_id)?;
1474 let target = self.unit(target_id)?;
1475 knight.ok_if_on_map()?;
1476 knight.ok_if_javelin_unlocked()?;
1477 knight.ok_if_within_ability_range(target.location())?;
1478 Ok(())
1479 }
1480
1481 /// Whether the knight can javelin the given robot, without taking into
1482 /// account the knight's ability heat. Takes into account only the knight's

Callers 2

can_javelinMethod · 0.80
javelinMethod · 0.80

Calls 6

my_unitMethod · 0.80
ok_if_on_mapMethod · 0.80
locationMethod · 0.80
unitMethod · 0.45

Tested by

no test coverage detected