示例#1
0
 private static void tryChargeElectricVehicle(Garage i_Garage, string i_LicensePlate)
 {
     if (i_Garage.IsElectricVehicle(i_LicensePlate))
     {
         float chargingTime = getEnergyAmountToAdd(i_Garage.VehiclesInTheGarage[i_LicensePlate].OwnersVehicle);
         i_Garage.FillEnergy(i_LicensePlate, chargingTime);
     }
     else
     {
         Console.WriteLine("Can't Charge Non-Electric Vehicle");
     }
 }