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); }
public override Pizza createPizza(string type) { Pizza pizza = null; PizzaIngredientFactory ingredientFactory = new ChicagoPizzaIngredientFactory(); if (type.Equals("cheese")) { pizza = new ChicagoStyleCheesePizza(ingredientFactory); pizza.name = "Chicago Style Cheese Pizza"; } else if (type.Equals("pepperoni")) { pizza = new PepperoniPizza(ingredientFactory); pizza.name = "Chicago Style Pepperoni Pizza"; } else if (type.Equals("clam")) { pizza = new ClamPizza(ingredientFactory); pizza.name = "Chicago Style Clam Pizza"; } else if (type.Equals("veggie")) { pizza = new VeggiePizza(ingredientFactory); pizza.name = "Chicago Style Veggie Pizza"; } return(pizza); }
protected override Pizza CreatePizza(string type) { Pizza pizza = null; if (type == "Cheese") { pizza = new ChicagoStyleCheesePizza(); } else if (type == "Veggie") { pizza = new ChicagoStyleVeggiePizza(); } return(pizza); }