示例#1
0
        private ClientVehicle findClientVehicleInGarageByLicenseNumber(string i_LicenseNumber)
        {
            ClientVehicle WantedClientVehicle = r_ClientVehiclesCollection[i_LicenseNumber];

            if (WantedClientVehicle == null)
            {
                throw new ArgumentException(string.Format("License Number: {0}, don't exist in the garage.", i_LicenseNumber));
            }

            return(WantedClientVehicle);
        }
示例#2
0
        public bool AddVehicleToGarage(ClientVehicle i_NewClientVehicle)
        {
            bool isNewClientVehicleHasAdded = true;

            if (r_ClientVehiclesCollection.ContainsKey(i_NewClientVehicle.GetVehicleLicenseCode()) == false)
            {
                addClientVehicleToGarageCollection(i_NewClientVehicle);
            }
            else
            {
                ChangeClientVehicleStatus(i_NewClientVehicle.GetVehicleLicenseCode(), ClientVehicle.eClientVehicleStatus.InRepair);
                isNewClientVehicleHasAdded = false;
            }

            return(isNewClientVehicleHasAdded);
        }
示例#3
0
        public void RechargeClientVehicleByLicenseNumber(string i_LicenseNumber, float i_AmountOfMinutes)
        {
            ClientVehicle clientVehiclesToCharge = findClientVehicleInGarageByLicenseNumber(i_LicenseNumber);

            clientVehiclesToCharge.RechargeVehicle(i_AmountOfMinutes);
        }
示例#4
0
        public void RefuelClientVehicleByLicenseNumber(string i_LicenseNumber, FueledEngine.eFuelType i_WantedFuelType, float i_AmountOfFuel)
        {
            ClientVehicle clientVehiclesToRefuel = findClientVehicleInGarageByLicenseNumber(i_LicenseNumber);

            clientVehiclesToRefuel.RefuelVehicle(i_AmountOfFuel, i_WantedFuelType);
        }
示例#5
0
        public void InflateTiresOfClientVehicleToMaximum(string i_LicenseNumber)
        {
            ClientVehicle clientVehicleToInflate = findClientVehicleInGarageByLicenseNumber(i_LicenseNumber);

            clientVehicleToInflate.InflateVehicleTiresToMaximum();
        }
示例#6
0
        public void ChangeClientVehicleStatus(string i_LicenseNumber, ClientVehicle.eClientVehicleStatus i_NewClientVehicleStatus)
        {
            ClientVehicle clientVehiclesToChange = findClientVehicleInGarageByLicenseNumber(i_LicenseNumber);

            clientVehiclesToChange.ClientVehicleStatus = i_NewClientVehicleStatus;
        }
示例#7
0
        public string GetClientVehicleInformation(string i_LicenseNumber)
        {
            ClientVehicle clientVehicle = findClientVehicleInGarageByLicenseNumber(i_LicenseNumber);

            return(clientVehicle.GetClientVehicleInformation());
        }
示例#8
0
 private void addClientVehicleToGarageCollection(ClientVehicle i_NewClientVehicle)
 {
     r_ClientVehiclesCollection.Add(i_NewClientVehicle.GetVehicleLicenseCode(), i_NewClientVehicle);
 }