protected override Pizza createPizza(string type) { Pizza pizza = null; if (type.Equals("cheese")) { pizza = new NYStyleCheesePizza(); } else if (type.Equals("sauce")) { pizza = new NYStyleSausePizza(); } return(pizza); }
//public NYPizzaStore(SimplePizzaFactory factory) : base(factory) //{ // Console.WriteLine("NYPizzaStore!!"); //} protected override Pizza CreatePizza(string type) { Pizza pizza = null; if (type.Equals("cheese")) { pizza = new NYStyleCheesePizza(); } else if (type.Equals("peperoni")) { pizza = new NYStylePeperoniPizza(); } else if (type.Equals("veggie")) { pizza = new NYStyleVeggiePizza(); } else if (type.Equals("clam")) { pizza = new NYStyleClamPizza(); } return(pizza); }