public void ChangeDriver(Driver newDriver) { if (!newDriver.Equals(_currentDriver)) { _currentDriver = newDriver; } }
public static void Main(string[] args) { var car = F1Car.GetDefaultCar(); var schumacher = new Driver("Michael Schumacher" ); car.ChangeDriver(schumacher); // car.StartEngine(); var started = car.TryStartEngine(); var toroRossoCar = new F1Car("Toro Rosso"); var verstappen = new Driver("Max Emilian Verstappen"); verstappen.SetCar(toroRossoCar); }