The cost of the unit in a factory. InappropriateUnitType - the unit type cannot be produced in a factory.
(self)
| 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 | /// |
no outgoing calls