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

Method can_blueprint

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

Whether the worker can blueprint a structure of the given type. The worker can only blueprint factories, and rockets if Rocketry has been researched. The team must have sufficient karbonite in its resource pool. The worker cannot already have performed an action this round.

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

Source from the content-addressed store, hash-verified

1289 /// researched. The team must have sufficient karbonite in its resource
1290 /// pool. The worker cannot already have performed an action this round.
1291 pub fn can_blueprint(&self, worker_id: UnitID, unit_type: UnitType,
1292 direction: Direction) -> bool {
1293 self.ok_if_can_blueprint(worker_id, unit_type, direction).is_ok()
1294 }
1295
1296 /// Blueprints a unit of the given type in the given direction. Subtract
1297 /// cost of that unit from the team's resource pool, and removes the

Callers 3

run.pyFile · 0.45
run.pyFile · 0.45
examplefuncsplayerFunction · 0.45

Calls 1

ok_if_can_blueprintMethod · 0.80

Tested by

no test coverage detected