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); } } }
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); } } }
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"); } }
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()); } } }