Example #1
0
        public override Pizza PreparePizza(string type)
        {
            Pizza pizza = null;

            if (type.Equals("standard"))
            {
                pizza = new AmericanPizza();
            }
            else if (type.Equals("bacon"))
            {
                pizza = new AmericanPizzaWithBacon();
            }
            return(pizza);
        }
Example #2
0
        public override Pizza PreparePizza(string type)
        {
            Pizza pizza = null;
            IIngredientsAbstractFactory americanIngredientsFactory = new AmericanPizzaIngredientsFactory();

            if (type.Equals("standard"))
            {
                pizza = new AmericanPizza(americanIngredientsFactory);
            }
            else if (type.Equals("bacon"))
            {
                pizza = new AmericanPizzaWithBacon(americanIngredientsFactory);
            }
            return(pizza);
        }