예제 #1
0
        public override Pizza createPizza(string type)
        {
            Pizza pizza;

            if (type.Equals("cheese"))
            {
                pizza = new ChicagoStyleCheesePizza();
            }
            else if (type.Equals("greek"))
            {
                pizza = new ChicagoStyleGreekPizza();
            }
            else if (type.Equals("peperoni"))
            {
                pizza = new ChicagoStylePeperoniPizza();
            }
            else if (type.Equals("clam"))
            {
                pizza = new ChicagoStyleClamPizza();
            }
            else if (type.Equals("veggie"))
            {
                pizza = new ChicagoStyleVeggiePizza();
            }
            else
            {
                pizza = new ChicagoStylePeperoniPizza();
            }

            return(pizza);
        }
예제 #2
0
        protected override Pizza CreatePizza(string type)
        {
            Pizza pizza = null;

            if (type == "Cheese")
            {
                pizza = new ChicagoStyleCheesePizza();
            }
            else if (type == "Veggie")
            {
                pizza = new ChicagoStyleVeggiePizza();
            }

            return(pizza);
        }