Beispiel #1
0
        private static void Main(string[] args)
        {
            Garage            garage   = new Garage();
            ExsoticCarFactory factory  = new ExsoticCarFactory();
            TunerCarFactory   Tfactory = new TunerCarFactory();

            Console.WriteLine(garage.BuildCar(factory));
            Console.WriteLine();
            Console.WriteLine(garage.BuildCar(Tfactory));
            Console.ReadKey();
        }
Beispiel #2
0
 public Car BuildCar(TunerCarFactory tunerFactory)
 {
     return(new Car(tunerFactory.CreateEngite(), tunerFactory.CreateTransmition(),
                    tunerFactory.CreateWheel(), tunerFactory.CreateBody(), tunerFactory.CreateTank()));
 }