public Driver(CarFactory carFactory) { if (carFactory == null) { throw new ArgumentNullException(nameof(carFactory)); } _sportsCar = carFactory.CreateSportsCar(); _familyCar = carFactory.CreateFamilyCar(); }
public Factory(FamilyCar familyCar, SportCar sportCar) { _familyCar = familyCar; _sportCar = sportCar; }
public abstract void Speed(FamilyCar famCar);
public override void Speed(FamilyCar famCar) { WriteLine(GetType().Name + " is faster than " + famCar.GetType().Name); }
public Driver(CarFactory carFactory) { _sportsCar = carFactory.CreateSportsCar(); _familyCar = carFactory.CreateFamilyCar(); }