internal Vehicle(string i_OwnerName, string i_OwnerPhone, string i_LicenseNumber, int i_NumberOfWheels, EnergyManager i_EnergyManager) { m_GarageInfo = new GarageInfo(i_OwnerName, i_OwnerPhone); m_Wheels = new Wheel[i_NumberOfWheels]; initWheels(); m_EnergyManager = i_EnergyManager; m_LicenseNumber = i_LicenseNumber; m_EnergyManager = i_EnergyManager; }
public virtual string GetInfo() { int count = 1; string countWheel = string.Empty; string msg = string.Format(@"License number: {0} Model name: {1} {2} Wheel description: ", LicenseNumber, ModelName, GarageInfo.GetInfo()); foreach (Wheel wheel in m_Wheels) { countWheel = string.Format("Wheel number ({0}) :{1} ", count, Environment.NewLine); msg += countWheel; msg += wheel.GetInfo(); count++; } return(msg); }