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

Method factory_cost

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

The cost of the unit in a factory. InappropriateUnitType - the unit type cannot be produced in a factory.

(self)

Source from the content-addressed store, hash-verified

163 ///
164 /// * InappropriateUnitType - the unit type cannot be produced in a factory.
165 pub fn factory_cost(self) -> Result<u32, GameError> {
166 match self {
167 UnitType::Worker => Ok(FACTORY_WORKER_COST),
168 UnitType::Knight => Ok(FACTORY_KNIGHT_COST),
169 UnitType::Ranger => Ok(FACTORY_RANGER_COST),
170 UnitType::Mage => Ok(FACTORY_MAGE_COST),
171 UnitType::Healer => Ok(FACTORY_HEALER_COST),
172 _ => Err(GameError::InappropriateUnitType)?,
173 }
174 }
175
176 /// The cost to blueprint the unit.
177 ///

Callers 3

produce_robotMethod · 0.80
test_factory_productionFunction · 0.80

Calls

no outgoing calls

Tested by 1

test_factory_productionFunction · 0.64