static void Main(string[] args) { ToyotaCarFactory factory = new AllionCarFactory(); new CarAssembler().AssembleCar(factory); ToyotaCarFactory factory2 = new CommonCarFactory(); ToyotaCar car = factory2.GetCar("Allion"); Console.WriteLine($"Created {car.Name}"); }
public void AssembleCar(ToyotaCarFactory factory) { ToyotaCar toyotaCar = factory.GetCar(); Console.WriteLine($"Created car {toyotaCar.Name} with {toyotaCar.Enginecc} cc"); }