protected override Pizza CreatePizza(string type) { Pizza pizza = null; IPizzaIngredientsFactory pizzaIngredientsFactory = new ChicagoPizzaIngredientsFactory(); if (type.Equals("cheese")) { pizza = new ChigadoPizzaCheese(pizzaIngredientsFactory); } return(pizza); }
protected override Pizza createPizza(E_PizzaType type) { Pizza pizza; I_PizzaIngredientFactory ingredientFactory = new ChicagoPizzaIngredientsFactory(); switch (type) { case E_PizzaType.CHEESE_PIZZA: pizza = new CheesePizza(ingredientFactory); pizza.pizzaType = type; pizza.name = "Chicago Style Cheese Pizza"; break; case E_PizzaType.PEPPERONI_PIZZA: pizza = new PepperoniPizza(ingredientFactory); pizza.pizzaType = type; pizza.name = "Chicago Style Pepperoni Pizza"; break; case E_PizzaType.CLAM_PIZZA: pizza = new ClamPizza(ingredientFactory); pizza.pizzaType = type; pizza.name = "Chicago Style Clam Pizza"; break; case E_PizzaType.VEGGIE_PIZZA: pizza = new VeggiePizza(ingredientFactory); pizza.pizzaType = type; pizza.name = "Chicago Style Veggie Pizza"; break; default: pizza = null; break; } return(pizza); }
public override Pizza CreatePizza(string type) { cutStyle = "square"; Pizza pizza = null; IIngredientsFactory ingredientsFactory = new ChicagoPizzaIngredientsFactory(); switch (type) { case "Cheese": pizza = new CheesePizza(ingredientsFactory); pizza.setName("Chicago Style Cheese Pizza"); break; case "Clam": pizza = new ClamPizza(ingredientsFactory); pizza.setName("Chicago Style Clam Pizza"); break; default: Console.WriteLine("Please select valid pizza type."); break; } return(pizza); }