protected override Pizza Create(string type) { Pizza pizza; IIngredientsFactory ingredients = new PizzeriaAIngredientsFactory(); if (type.Equals("Cheese")) { pizza = new CheesePizza(ingredients) { Name = "Pizzeria A Style Cheese" }; } else if (type.Equals("Clam")) { pizza = new ClamPizza(ingredients) { Name = "Pizzeria A Style Clam" }; } else { pizza = new VeggiePizza(ingredients) { Name = "Pizzeria A Style Veggie" }; } pizza.Color = "red"; return(pizza); }
public override Pizza CreatePizza(string type) { Pizza pizza = null; PizzaIngredientsFactory ingredientsFactory = new NYPizzaIngredientFactory(); switch (type) { case "cheese": pizza = new CheesePizza(ingredientsFactory); /*new chesee pizza*/ break; case "clam": pizza = new ClamPizza(ingredientsFactory); break; default: pizza = null; break; } return(pizza); }
public override Pizza CreatePizza(string type) { Pizza pizza = null; PizzaIngredientsFactory ingredientsFactory = new ChPizzaIngredientFactory(); switch (type) { case "cheese": pizza = new CheesePizza(ingredientsFactory); pizza.setName("Chicago Cheese Pizza"); break; case "clam": pizza = new ClamPizza(ingredientsFactory); break; default: pizza = null; break; } return(pizza); }
protected override Pizza Create(string type) { Pizza pizza; IIngredientsFactory ingredients = new PizzeriaBIngredientsFactory(); if (type.Equals("Cheese")) { pizza = new CheesePizza(ingredients); pizza.Name = "Pizzeria B Cheese"; } else if (type.Equals("Clam")) { pizza = new ClamPizza(ingredients); pizza.Name = "Pizzeria B Clam"; } else { pizza = new VeggiePizza(ingredients); pizza.Name = "Pizzeria B Veggie"; } pizza.Color = "green"; return(pizza); }