public void FuelVehicle(string vehicleID, eFuelType fuelType, float amountOfFuelToAdd) { PoweredByFuel powerType = m_VehiclesInGarage[vehicleID].PowerType as PoweredByFuel; if (powerType != null) { powerType.addFuel(fuelType, amountOfFuelToAdd); } }
public Truck(bool isElectricPoweredTruck) { m_VehicleWheels = new List <Wheel>(); for (int i = 0; i < k_NumOfWheelsInTruck; i++) { Wheel wheelToAdd = new Wheel(); wheelToAdd.MaximumAirPressure = k_MaxAirPressureInTruckWheel; m_VehicleWheels.Add(wheelToAdd); } TruckPowerType = new PoweredByFuel(k_FuelPoweredTruckFuelType, k_MaxFuelTankCapacityInFuelPoweredTruck); }
public Motorcycle(bool isElectricMotorcycle) { m_VehicleWheels = new List <Wheel>(); for (int i = 0; i < k_NumOfWheelsInMotorcycle; i++) { Wheel wheelToAdd = new Wheel(); wheelToAdd.MaximumAirPressure = k_MaxAirPressureInMotorcycleWheel; m_VehicleWheels.Add(wheelToAdd); } if (isElectricMotorcycle) { MotorcyclePowerType = new PoweredByElectricity(k_MaxBatteryCapacityInElectricMotorcycle); } else { MotorcyclePowerType = new PoweredByFuel(k_FuelPoweredMotorcycleeFuelType, k_MaxFuelTankCapacityInFuelPoweredMotorcycle); } }