Esempio n. 1
0
        internal ElectricCar(string i_LicenseId, string i_NameOfModel, float i_EnergyPrecent)
            : base(i_LicenseId, i_NameOfModel)
        {
            float currentCapcaity = i_EnergyPrecent * 1.8f / 100f;

            m_EnergySystem = new ElectricEnergySystem(1.8f, currentCapcaity);
        }
Esempio n. 2
0
        internal ElectricBike(string i_LicenseId, string i_NameOfModel, float i_EnergyPrecent)
            : base(i_LicenseId, i_NameOfModel)
        {
            float currentCapcity = i_EnergyPrecent * 1.4f / 100f;

            m_EnergySystem = new ElectricEnergySystem(1.4f, currentCapcity);
            m_VehicleInfo  = new VehicleInfo();
        }
Esempio n. 3
0
        public void ChargeElectricVehicle(string i_LicenseNum, int i_AmountMinToCharge)
        {
            float                realNumberInHour     = i_AmountMinToCharge / 60f;
            Customer             customer             = TryToGetCustomer(i_LicenseNum);
            ElectricEnergySystem electricEnergySystem = customer.Vehicle.EnergySystem as ElectricEnergySystem;

            if (electricEnergySystem != null)
            {
                electricEnergySystem.ChargeBattery(realNumberInHour);
            }
            else
            {
                throw new FormatException("The Object doesn't have Electric system");
            }
        }