internal ElectricMotrobike(string i_ModelName, string i_LicenseNumber, float i_CurrentBatteryTimePrecent) : base(i_ModelName, i_LicenseNumber) { float currEnergy = i_CurrentBatteryTimePrecent * 1.2f / 100; m_VehicleEngineEnergy = new ElectricalEnergy(1.2f, currEnergy); }
internal ElectricCar(string i_LicenseNumber, string i_ModelName, float i_CurrentBatteryTimePrecent) : base(i_LicenseNumber, i_ModelName) { float currEnergy = i_CurrentBatteryTimePrecent * 2.1f / 100f; m_VehicleEngineEnergy = new ElectricalEnergy(2.1f, currEnergy); }
public void ChargeVehicle(string i_LicenseNumber, int i_AmountOfMinToCharge) { Client client = GetClient(i_LicenseNumber); float chargeNumberInHour = i_AmountOfMinToCharge / 60f; ElectricalEnergy electricEnergySystem = client.Vehicle.Energy as ElectricalEnergy; if (electricEnergySystem != null) { electricEnergySystem.BatteryCharge(chargeNumberInHour); } else { throw new FormatException("This vehicle has no electrical system"); } }