Exemplo n.º 1
0
        private static void CreateAndDisplayCar(ref IVehicleFactory factory)
        {
            factory = AutoMBuilder.Build(BodyType.Car);

            IVehicle vehicle = factory.GetVehicle(IgnitionType.Automatic.ToString());

            WriteLine($" Vehicle {factory.ToString()}");

            vehicle = factory.GetVehicle(IgnitionType.Hybrid.ToString());
            WriteLine($" Vehicle {factory.ToString()}");

            vehicle = factory.GetVehicle(IgnitionType.None.ToString());
            WriteLine($" Vehicle {factory.ToString()}");

            ReadKey();
        }