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); }
protected override Pizza CreatePizza(string type) { Pizza pizza = null; if (type == "Cheese") { pizza = new ChicagoStyleCheesePizza(); } else if (type == "Veggie") { pizza = new ChicagoStyleVeggiePizza(); } return(pizza); }