protected void SetBodyEngineObject(IVehicle vehicleObj, string vehicleType) { IgnitionType eIgnitionType = IgnitionType.None; Enum.TryParse(vehicleType, out eIgnitionType); var bodyObj = vehicleObj.GetVehicleBody(BodyType.None); var engineType = vehicleObj.GetVehicleEngine(bodyObj, eIgnitionType); VehicleObject = vehicleObj; AutoBody = bodyObj; EngineType = engineType; }
public string ToString(IAutoBody body, IAutoEngine engine) { return($" AutoBody { body?.ToString() } \r\n AutoEngine { engine?.ToString() } "); }