public override BlankPizza GetPizza() { BlankPizza newPizza = pizza; pizza = new Margarita(); return(newPizza); }
public override BlankPizza GetPizza() { BlankPizza newPizza = pizza; pizza = new Carbonara(); return(newPizza); }
public override BlankPizza GetPizza() { BlankPizza newPizza = pizza; pizza = new Pepperoni(); return(newPizza); }
public override BlankPizza GetPizza() { BlankPizza newPizza = pizza; pizza = new Italian(); return(newPizza); }
static void Main(string[] args) { PizzaBuilder carbonaraBuilder = new CarbonaraBuilder(); carbonaraBuilder.SetCheese().SetTomatoes().SetOlives().SetMeat(); BlankPizza pizza1 = carbonaraBuilder.GetPizza(); Console.WriteLine(pizza1.GetComponentPizza()); carbonaraBuilder.SetCheese().SetMeat(); BlankPizza pizza2 = carbonaraBuilder.GetPizza(); Console.WriteLine("\n" + pizza2.GetComponentPizza()); Console.ReadKey(); }