Ejemplo n.º 1
0
        public override Pizza CreatePizza(string item)
        {
            Pizza pizza = null;
            IPizzaIngredientFatory pizzaIngredientFatory = new ChicagoIngredientFactory();
            if (item.Equals("cheese"))
            {
                pizza = new CheesePizza(pizzaIngredientFatory);
                pizza.SetName("New York Style Cheese pizza");
            }

            else if (item.Equals("clam"))
            {
                pizza = new ClamPizza(pizzaIngredientFatory);
                pizza.SetName("New York Style Clam pizza");
            }
            return pizza;
        }
Ejemplo n.º 2
0
        public override Pizza CreatePizza(string item)
        {
            Pizza pizza = null;
            IPizzaIngredientFatory pizzaIngredientFatory = new ChicagoIngredientFactory();

            if (item.Equals("cheese"))
            {
                pizza = new CheesePizza(pizzaIngredientFatory);
                pizza.SetName("New York Style Cheese pizza");
            }

            else if (item.Equals("clam"))
            {
                pizza = new ClamPizza(pizzaIngredientFatory);
                pizza.SetName("New York Style Clam pizza");
            }
            return(pizza);
        }