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); } }
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); } }
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; } }
public bool ClientExists(string i_LicensePlate) { bool doesClientExist = false; GarageClient client = null; if (m_GarageDictonary.TryGetValue(i_LicensePlate, out client)) { doesClientExist = true; } return(doesClientExist); }
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); }
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()) { } } }
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 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 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()); } } }
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()); } } }
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); }
public void AddClient(string i_LicensePlate, GarageClient i_Client) { this.m_GarageDictonary.Add(i_LicensePlate, i_Client); }