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

Method ok_if_move_ready

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

Ok if the unit is ready to move. The movement heat must be lower than the maximum heat to attack. InappropriateUnitType - the unit is not a robot. Overheated - the unit is not ready to move.

(&self)

Source from the content-addressed store, hash-verified

487 /// * InappropriateUnitType - the unit is not a robot.
488 /// * Overheated - the unit is not ready to move.
489 pub(crate) fn ok_if_move_ready(&self) -> Result<(), GameError> {
490 if self.movement_heat()? >= MAX_HEAT_TO_ACT {
491 Err(GameError::Overheated)?;
492 }
493 Ok(())
494 }
495
496 /// Updates the unit's location as it if has moved, and increases the
497 /// movement heat.

Callers

nothing calls this directly

Calls 1

movement_heatMethod · 0.80

Tested by

no test coverage detected