コード例 #1
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);
                }
            }
        }
コード例 #2
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);
                }
            }
        }
コード例 #3
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");
            }
        }
コード例 #4
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());
                }
            }
        }