Exemplo n.º 1
0
        public Pizza CreatePizza(string type)
        {
            Pizza pizza = null;

            switch (type)
            {
            case "cheese":
                pizza = new CheesePizza();
                break;

            case "pepperoni":
                pizza = new PepperoniPizza();
                break;

            case "clam":
                pizza = new ClamPizza();
                break;

            case "veggie":
                pizza = new VeggiePizza();
                break;
            }

            return(pizza);
        }
Exemplo n.º 2
0
        public IPizza CreatePizza(string type)
        {
            IPizza pizza = null;

            switch (type)
            {
            case "Cheese":
                pizza = new CheesePizza();
                break;

            case "Veggie":
                pizza = new VeggiePizza();
                break;

            case "Clam":
                pizza = new ClamPizza();
                break;

            case "Pepperoni":
                pizza = new PepperoniPizza();
                break;

            default:
                Console.WriteLine("Please select valid pizza type.");
                break;
            }

            // This will create my pizza based on the process defined in different pizza's
            pizza.prepare();
            pizza.bake();
            pizza.cut();
            pizza.box();

            return(pizza);
        }
Exemplo n.º 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;
        }
Exemplo n.º 4
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;
        }
Exemplo n.º 5
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);
        }
Exemplo n.º 6
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);
        }
Exemplo n.º 7
0
        public IPizza CreatePizza(string pizzaType)
        {
            IPizza pizza = null;

            if (pizzaType.Equals("cheese"))
            {
                pizza = new CheesePizza();
            }
            else if (pizzaType.Equals("pepperoni"))
            {
                pizza = new PepperoniPizza();
            }
            else if (pizzaType.Equals("clam"))
            {
                pizza = new ClamPizza();
            }
            else if (pizzaType.Equals("veggie"))
            {
                pizza = new VeggiePizza();
            }

            return(pizza);
        }