Beispiel #1
0
        public Pizza CreatePizza(string type)
        {
            Pizza pizza = null;

            if (type == "Cheese")
                pizza = new CheesePizza();
            else if (type == "Clam")
                pizza = new ClamPizza();
            else if (type == "Suede")
                pizza = new ShoePizza();

            return pizza;
        }
Beispiel #2
0
        // portland-style preparation for all pizzas
        protected override Pizza CreatePizza(string type)
        {
            Pizza pizza = null;
            IIngredientFactory ingredientFactory =
                new PortlandIngredientFactory();

            if (type == "Cheese")
                pizza = new CheesePizza(ingredientFactory);
            else if (type == "Clam")
                pizza = new ClamPizza(ingredientFactory);
            else if (type == "Suede")
                pizza = new ShoePizza(ingredientFactory);

            return pizza;
        }
Beispiel #3
0
        public Pizza CreatePizza(string type)
        {
            Pizza pizza = null;

            if (type == "Cheese")
            {
                pizza = new CheesePizza();
            }
            else if (type == "Clam")
            {
                pizza = new ClamPizza();
            }
            else if (type == "Suede")
            {
                pizza = new ShoePizza();
            }

            return(pizza);
        }
Beispiel #4
0
        // hillsboro-style preparation for all pizzas
        protected override Pizza CreatePizza(string type)
        {
            Pizza pizza = null;
            IIngredientFactory ingredientFactory =
                new HillsboroIngredientFactory();

            if (type == "Cheese")
            {
                pizza = new CheesePizza(ingredientFactory);
            }
            else if (type == "Clam")
            {
                pizza = new ClamPizza(ingredientFactory);
            }
            else if (type == "Suede")
            {
                pizza = new ShoePizza(ingredientFactory);
            }

            return(pizza);
        }