示例#1
0
        public void FuelVehcile(string i_LicensePlate, FueledEngine.eFuelType I_FuelType, float i_FuelAmount)
        {
            GarageClient client = null;

            if (m_GarageDictonary.TryGetValue(i_LicensePlate, out client))
            {
                ////need execption for fuel type here! (other exceptions are taking care of
                client.m_Vehicle.GetEngine().RePower(i_FuelAmount);
            }
        }
示例#2
0
        public void ChargeVehicle(string i_LicensePlate, float i_MinutesToCharge)
        {
            GarageClient client = null;

            if (m_GarageDictonary.TryGetValue(i_LicensePlate, out client))
            {
                ////need execption for fuel type here! (other exceptions are taking care of
                client.m_Vehicle.GetEngine().RePower(i_MinutesToCharge);
            }
        }
示例#3
0
        public void UpdateCarStatus(string i_LicensePlate, GarageClient.eVehicleStatus i_NewSatus)
        {
            ////exceptions here?

            GarageClient client = null;

            if (m_GarageDictonary.TryGetValue(i_LicensePlate, out client))
            {
                client.m_Status = i_NewSatus;
            }
        }
示例#4
0
        public bool ClientExists(string i_LicensePlate)
        {
            bool         doesClientExist = false;
            GarageClient client          = null;

            if (m_GarageDictonary.TryGetValue(i_LicensePlate, out client))
            {
                doesClientExist = true;
            }

            return(doesClientExist);
        }
示例#5
0
        public string GetFullClientInfo(string i_LicensePlate)
        {
            GarageClient client   = null;
            string       toReturn = string.Empty;

            if (m_GarageDictonary.TryGetValue(i_LicensePlate, out client))
            {
                toReturn = client.ToString();
            }

            return(toReturn);
        }
示例#6
0
        public void DisplayFullClientInfo(string i_LicensePlate)
        {
            GarageClient client         = null;
            Type         propertiesDict = typeof(List <>);

            if (m_GarageDictonary.TryGetValue(i_LicensePlate, out client))
            {
                foreach (var clientProperty in client.GetType().GetProperties())
                {
                }
            }
        }
示例#7
0
        public void ChargeVehicle(string i_MainLicensePlate, string i_CurrentLicensePlate, float i_MinutesToCharge)
        {
            GarageClient o_Client = null;

            GarageClient.SingleVehicleInfo o_InnerDict = null;
            if (m_GarageDictonary.TryGetValue(i_MainLicensePlate, out o_Client))
            {
                if (o_Client.m_Vehicles.TryGetValue(i_CurrentLicensePlate, out o_InnerDict))
                {
                    o_InnerDict.m_Vehicle.GetEngine().RePower(i_MinutesToCharge);
                }
            }
        }
示例#8
0
        public void FuelVehicle(string i_MainLicensePlate, string i_CurrentLicensePlate, FueledEngine.eFuelType i_FuelType, float i_FuelAmount)
        {
            GarageClient o_Client = null;

            GarageClient.SingleVehicleInfo o_InnerDict = null;
            if (m_GarageDictonary.TryGetValue(i_MainLicensePlate, out o_Client))
            {
                if (o_Client.m_Vehicles.TryGetValue(i_CurrentLicensePlate, out o_InnerDict))
                {
                    o_InnerDict.m_Vehicle.GetEngine().RePower(i_FuelAmount);
                }
            }
        }
示例#9
0
        public void SetTirePressureToMax(string i_LicensePlate)
        {
            GarageClient client       = null;
            List <Wheel> allCarWheels = null;

            if (m_GarageDictonary.TryGetValue(i_LicensePlate, out client))
            {
                allCarWheels = client.m_Vehicle.GetWheels();
                foreach (Wheel currentWheel in allCarWheels)
                {
                    currentWheel.SetTirePressure(currentWheel.GetMaxTirePressure());
                }
            }
        }
示例#10
0
        public void UpdateVehicleStatus(string i_MainLicensePlate, string i_CurrentLicensePlate, GarageClient.eVehicleStatus i_NewSatus)
        {
            GarageClient o_Client = null;

            GarageClient.SingleVehicleInfo o_InnerDict = null;
            if (m_GarageDictonary.TryGetValue(i_MainLicensePlate, out o_Client))
            {
                o_Client.m_Vehicles.TryGetValue(i_CurrentLicensePlate, out o_InnerDict);
                o_InnerDict.m_Status = i_NewSatus;
            }
            else
            {
                throw new Exception("License plate number not found in the garage");
            }
        }
示例#11
0
        public void SetTirePressureToMax(string i_MainLicensePlate, string i_CurrentLicensePlate)
        {
            GarageClient o_Client = null;

            Wheel[] allCarWheels = null;
            GarageClient.SingleVehicleInfo o_InnerDict = null;
            if (m_GarageDictonary.TryGetValue(i_MainLicensePlate, out o_Client))
            {
                o_Client.m_Vehicles.TryGetValue(i_CurrentLicensePlate, out o_InnerDict);
                allCarWheels = o_InnerDict.m_Vehicle.GetWheels();
                foreach (Wheel currentWheel in allCarWheels)
                {
                    currentWheel.SetTirePressure(currentWheel.GetMaxTirePressure());
                }
            }
        }
示例#12
0
        public int ManageClient(GarageClient i_GarageClient)
        {
            //1 - means the car already in the shop, 0 means new car entry
            int    returnValue        = 0;
            string clientLicensePlate = i_GarageClient.m_Vehicle.GetLicensePlate();

            if (m_GarageDictonary.ContainsKey(clientLicensePlate))
            {
                i_GarageClient.m_Status = GarageClient.eVehicleStatus.InRepair;
                returnValue             = 1;
            }
            else
            {
                m_GarageDictonary.Add(clientLicensePlate, i_GarageClient);
            }

            return(returnValue);
        }
示例#13
0
 public void AddClient(string i_LicensePlate, GarageClient i_Client)
 {
     this.m_GarageDictonary.Add(i_LicensePlate, i_Client);
 }