public Pizza OrderPizza(params string[] type)
        {
            Pizza pizza = factory.CreatePizza(type);

            pizza.Prepare();
            pizza.Bake();
            pizza.Cut();
            pizza.Box();

            return(pizza);
        }
        public Pizza Order(string type)
        {
            Pizza pizza = CreatePizza(type);

            pizza.Prepare();
            pizza.bake();
            pizza.cut();
            pizza.box();

            return(pizza);
        }
        static void Main(string[] args)
        {
            PizzaFactory pizzaFactory = new NYPizzaFactory();

            Pizza pizza = pizzaFactory.CreatePizza("Margarita");

            pizza.Prepare();
            pizza.Bake();
            pizza.Cut();
            pizza.Box();
        }
Esempio n. 4
0
        static void Main(string[] args)
        {
            PizzaStore dbstore = new DBPizzaStore();
            //PizzaStore bjstore = new BJPizzaStore();

            Pizza pizza = dbstore.OrderPizza("cheese");

            Console.WriteLine(pizza.GetName());
            Console.WriteLine(pizza.Prepare());
            Console.WriteLine(pizza.Cut());
            Console.WriteLine(pizza.Box());
            Console.WriteLine(pizza.Bake());

            //pizza = bjstore.OrderPizza("cheese");
            //Console.WriteLine(pizza.GetName());
        }