public override Pizza PreparePizza(string type) { Pizza pizza = null; if (type.Equals("standard")) { pizza = new AmericanPizza(); } else if (type.Equals("bacon")) { pizza = new AmericanPizzaWithBacon(); } return(pizza); }
public override Pizza PreparePizza(string type) { Pizza pizza = null; IIngredientsAbstractFactory americanIngredientsFactory = new AmericanPizzaIngredientsFactory(); if (type.Equals("standard")) { pizza = new AmericanPizza(americanIngredientsFactory); } else if (type.Equals("bacon")) { pizza = new AmericanPizzaWithBacon(americanIngredientsFactory); } return(pizza); }