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

Method can_harvest

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

Whether the worker is ready to harvest, and the given direction contains karbonite to harvest. The worker cannot already have performed an action this round.

(&self, worker_id: UnitID, direction: Direction)

Source from the content-addressed store, hash-verified

1222 /// karbonite to harvest. The worker cannot already have performed an action
1223 /// this round.
1224 pub fn can_harvest(&self, worker_id: UnitID, direction: Direction) -> bool {
1225 self.ok_if_can_harvest(worker_id, direction).is_ok()
1226 }
1227
1228 /// Harvests up to the worker's harvest amount of karbonite from the given
1229 /// location, adding it to the team's resource pool.

Callers

nothing calls this directly

Calls 1

ok_if_can_harvestMethod · 0.80

Tested by

no test coverage detected