protected override Pizza CreatePizza(string item)
        {
            Pizza pizza = null;
            IPizzaIngredientFactory ingredientFactory = new NYPizzaIngredientFactory();

            if (item.Equals(PizzaIngredientFactoryConstants.CHEESE_PIZZA))
            {
                pizza = new CheesePizza(ingredientFactory);
                pizza.SetName("New York Style Cheese Pizza");
            }
            else if (item.Equals(PizzaIngredientFactoryConstants.VEGGIE_PIZZA))
            {
                pizza = new VeggiePizza(ingredientFactory);
                pizza.SetName("New York Style Veggie Pizza");
            }
            else if (item.Equals(PizzaIngredientFactoryConstants.CLAM_PIZZA))
            {
                pizza = new ClamPizza(ingredientFactory);
                pizza.SetName("New York Style Clam Pizza");
            }
            else if (item.Equals(PizzaIngredientFactoryConstants.PEPPERONI_PIZZA))
            {
                pizza = new PepperoniPizza(ingredientFactory);
                pizza.SetName("New York Style Pepperoni Pizza");
            }
            return(pizza);
        }
Exemple #2
0
        protected override Pizza CreatePizza(string type)
        {
            Pizza pizza = null;
            IPizzaIngredientFactory ingredientFactory = new NewYorkIngredientFactory();

            if (type.Equals("Cheese"))
            {
                pizza = new CheesePizza(ingredientFactory);
                pizza.SetName("New York Style Cheese");
            }
            else if (type.Equals("Greek"))
            {
                pizza = new GreekPizza(ingredientFactory);
                pizza.SetName("New York Style Greek");
            }
            else if (type.Equals("Pepperoni"))
            {
                pizza = new PepperoniPizza(ingredientFactory);
                pizza.SetName("New York Style Cheese Pepperoni");
            }
            else if (type.Equals("Veggie"))
            {
                pizza = new VeggiePizza(ingredientFactory);
                pizza.SetName("New York Style Veggie");
            }
            else if (type.Equals("Clam"))
            {
                pizza = new ClamPizza(ingredientFactory);
                pizza.SetName("New York Style Clam");
            }

            return(pizza);
        }
        public override Pizza CreatePizza(string pizzaType)
        {
            Pizza pizza = null;
            IPizzaIngredientFactory ingredientFactory = new NYPizzaIngredientFactory();

            switch (pizzaType)
            {
            case "cheese":
                pizza = new CheesePizza(ingredientFactory);
                pizza.SetName("New York Style Cheese Pizza");
                break;

            case "veggie":
                pizza = new VeggiePizza(ingredientFactory);
                pizza.SetName("New York Style Veggie Pizza");
                break;

            case "clam":
                pizza = new ClamPizza(ingredientFactory);
                pizza.SetName("New York Style Clam Pizza");
                break;

            case "pepperoni":
                pizza = new PepperoniPizza(ingredientFactory);
                pizza.SetName("New York Style Pepperoni Pizza");
                break;
            }

            return(pizza);
        }
        protected override Pizza CreatePizza(string type)
        {
            Pizza pizza;
            var   ingredientFactory = new ChicagoPizzaIngredientFactory();

            switch (type)
            {
            case "cheese":
                pizza = new CheesePizza(ingredientFactory);
                pizza.SetName("New York Style Cheese Pizza");
                break;

            case "clam":
                pizza = new ClamPizza(ingredientFactory);
                pizza.SetName("New York Style Clam Pizza");
                break;

            case "veggie":
                pizza = new VeggiePizza(ingredientFactory);
                pizza.SetName("New York Style Veggie Pizza");
                break;

            case "pepperoni":
                pizza = new PepperoniPizza(ingredientFactory);
                pizza.SetName("New York Style Pepperoni Pizza");
                break;

            default:
                pizza = null;
                break;
            }

            return(pizza);
        }
Exemple #5
0
        public override Pizza CreatePizza(string type)
        {
            Pizza pizza = null;
            IPizzaIngredientFactory pizzaIngredientFactory = new NYPizzaIngredientFactory();

            if (type == "cheese")
            {
                pizza = new CheesePizza(pizzaIngredientFactory);
                pizza.SetName("New York Style Cheese Pizza");
            }
            else if (type == "clam")
            {
                pizza = new ClamPizza(pizzaIngredientFactory);
                pizza.SetName("New York Style Clam Pizza");
            }
            else if (type == "pepperoni")
            {
                pizza = new PepperoniPizza(pizzaIngredientFactory);
                pizza.SetName("New York Style Pepperoni Pizza");
            }
            else
            {
                return(null);
            }
            return(pizza);
        }
        protected override Pizza CreatePizza(PizzaType type)
        {
            Pizza pizza;

            switch (type)
            {
            case PizzaType.Cheese:
                pizza = new CheesePizza(_ingredientFactory);
                pizza.SetName("Chicago Style Cheese Pizza");
                break;

            case PizzaType.Pepperoni:
                pizza = new PepperoniPizza(_ingredientFactory);
                pizza.SetName("Chicago Style Pepperoni Pizza");
                break;

            case PizzaType.Clam:
                pizza = new ClamPizza(_ingredientFactory);
                pizza.SetName("Chicago Style Clam Pizza");
                break;

            case PizzaType.Veggie:
                pizza = new VeggiePizza(_ingredientFactory);
                pizza.SetName("Chicago Style Veggie Pizza");
                break;

            default:
                return(null);
            }

            return(pizza);
        }
        public override Pizza CreatePizza(string pizzaType)
        {
            Pizza pizza = null;
            IPizzaIngredientFactory ingredientFactory = new ChicagoPizzaIngredientFactory();

            switch (pizzaType)
            {
            case "cheese":
                pizza = new CheesePizza(ingredientFactory);
                pizza.SetName("Chicago Style Deep Dish Cheese Pizza");
                break;

            case "veggie":
                pizza = new VeggiePizza(ingredientFactory);
                pizza.SetName("Chicago Style Deep Dish Veggie Pizza");
                break;

            case "clam":
                pizza = new ClamPizza(ingredientFactory);
                pizza.SetName("Chicago Style Deep Dish Clam Pizza");
                break;

            case "pepperoni":
                pizza = new PepperoniPizza(ingredientFactory);
                pizza.SetName("Chicago Style Deep Dish Pepperoni Pizza");
                break;
            }

            return(pizza);
        }
        protected override Pizza CreatePizza(string type)
        {
            Pizza pizza = null;
            IPizzaIngredientFactory ingredientFactory = new NYPizzaIngredientFactory();

            if (type.Equals("cheese"))
            {
                pizza = new CheesePizza(ingredientFactory);
                pizza.SetName("New York Style Cheese Pizza");
            }
            else if (type.Equals("clam"))
            {
                pizza = new ClamPizza(ingredientFactory);
                pizza.SetName("New York Style Clam Pizza");
            }

            return(pizza);
        }
Exemple #9
0
        protected override PizzaAbstract CreatePizza(string type)
        {
            PizzaAbstract pizza = null;

            PizzaIngredientFactory ingredientFactory = new ChicagoPizzaIngredientFactory();

            if (type.Equals("cheese"))
            {
                pizza = new CheesePizza(ingredientFactory);
                pizza.SetName("Pizza de Queijo no Estilo de Chicago");
            }
            else if (type.Equals("clam"))
            {
                pizza = new ClamPizza(ingredientFactory);
                pizza.SetName("Pizza de Mariscos no Estilo de Chicago");
            }

            return(pizza);
        }
    public override Pizza CreatePizza(string type)
    {
        Pizza pizza = null;
        IPizzaIngredientFactory factory = new NYPizzaIngredientFactory();

        switch (type)
        {
        case "cheese":
            pizza = new CheesePizza(factory);
            pizza.SetName("NY Style Cheese Pizza");
            break;

        case "clam":
            pizza = new ClamPizza(factory);
            pizza.SetName("NY Style Clam Pizza");
            break;
        }

        return(pizza);
    }
Exemple #11
0
        protected override Pizza CreatePizza(string type)
        {
            Pizza pizza = null;

            if (type.Equals("cheese"))
            {
                pizza = new CheesePizza(_pizzaIngredientFactory);
                pizza.SetName("New York style cheese pizza");
            }
            else if (type.Equals("pepperoni"))
            {
                pizza = new PepperoniPizza(_pizzaIngredientFactory);
                pizza.SetName("New York style pepperoni pizza");
            }
            else if (type.Equals("clam"))
            {
                pizza = new ClamPizza(_pizzaIngredientFactory);
                pizza.SetName("New York style clam pizza");
            }

            return(pizza);
        }
Exemple #12
0
        protected override Pizza CreatePizza(string type)
        {
            Pizza pizza;
            IPizzaIngredientFactory ingredientFactory = new NYPizzaIngredientFactory();

            switch (type)
            {
            case "Cheese":
                pizza = new CheesePizza(ingredientFactory);
                pizza.SetName("NY Style Cheese Pizza");
                break;

            case "Clam":
                pizza = new ClamPizza(ingredientFactory);
                pizza.SetName("NY Style Clam Pizza");
                break;

            default:
                pizza = null;
                break;
            }

            return(pizza);
        }