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

Method ok_if_snipe_unlocked

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

Ok if the unit can snipe. InappropriateUnitType - the unit is not a ranger. ResearchNotUnlocked - the required technology is not unlocked.

(&self)

Source from the content-addressed store, hash-verified

802 /// * InappropriateUnitType - the unit is not a ranger.
803 /// * ResearchNotUnlocked - the required technology is not unlocked.
804 pub(crate) fn ok_if_snipe_unlocked(&self) -> Result<(), GameError> {
805 self.ok_if_unit_type(Ranger)?;
806 self.ok_if_ability_unlocked()?;
807 Ok(())
808 }
809
810 /// Updates the unit as if it has begun sniping. The unit's ability heat
811 /// does not increase until it has sniped.

Callers 2

ok_if_can_begin_snipeMethod · 0.80

Calls 2

ok_if_unit_typeMethod · 0.80

Tested by

no test coverage detected