public void LoadEngine(Engine engine) { if (_engine != null) { throw new InvalidOperationException(); } _engine = engine; }
public Car( Engine engine, Tyre[] tyres ) { LoadEngine (engine); if (tyres != null) { foreach (var item in tyres) { AddTyre (item); } } }
public Engine UnloadEngine() { var engine = _engine; _engine = null; return engine; }