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

Method ok_if_javelin_unlocked

battlecode-engine/src/unit.rs:712–716  ·  view source on GitHub ↗

Ok if the unit can javelin. InappropriateUnitType - the unit is not a knight. ResearchNotUnlocked - the required technology is not unlocked.

(&self)

Source from the content-addressed store, hash-verified

710 /// * InappropriateUnitType - the unit is not a knight.
711 /// * ResearchNotUnlocked - the required technology is not unlocked.
712 pub(crate) fn ok_if_javelin_unlocked(&self) -> Result<(), GameError> {
713 self.ok_if_unit_type(Knight)?;
714 self.ok_if_ability_unlocked()?;
715 Ok(())
716 }
717
718 /// Updates the unit as if it has javelined, and returns the damage done.
719 pub(crate) fn javelin(&mut self) -> i32 {

Callers 2

ok_if_can_javelinMethod · 0.80
ok_if_javelin_readyMethod · 0.80

Calls 2

ok_if_unit_typeMethod · 0.80

Tested by

no test coverage detected