static void Main(string[] args)
        {
            PizzaStore pizzaStore = new PizzaStore(new SimplePizzaFactory());

            pizzaStore.OrderPizza(PizzaType.Cheese);
            Console.WriteLine();
            pizzaStore.OrderPizza(PizzaType.Ham);
            Console.ReadKey();
        }
示例#2
0
        static void Main(string[] args)
        {
            Pizza pizza;
            SimplePizzaFactory santanaFactory  = new SimplePizzaFactory();
            PizzaStore         santanaPizzaria = new PizzaStore(santanaFactory);

            Console.WriteLine("I want a pizza.");
            pizza = santanaPizzaria.OrderPizza();
            pizza.PrintDescription();
            Console.WriteLine("For me one Napolitana please.");
            pizza = santanaPizzaria.OrderPizza(PizzaTypes.Napolitana);
            pizza.PrintDescription();
        }