Пример #1
0
        // methods

        // OrderPizza
        public Pizza OrderPizza(string pizzaType)
        {
            Pizza pizza = null;

            if (pizzaType == "pepperoni")
            {
                pizza = new Pepperoni();
            }
            // create pizza and return it
            // TODO: Create Pizza

            return(pizza);
        }
Пример #2
0
        public override Pizza CreatePizza(string type)
        {
            Pizza pizza = null;

            switch (type.ToLower().Trim())
            {
            case "cheese":
                pizza = new Cheese();
                break;

            case "pepperoni":
                Console.WriteLine("I have made pepperoni");
                pizza = new Pepperoni();
                break;

            default:
                break;
            }

            return(pizza);
        }