public static PizzaBuilder getInstance() { if (_instance == null) { _instance = new PizzaBuilder(); } return(_instance); }
public void execute() { var director = new PizzaDirector(); var builder = PizzaBuilder.getInstance(); director.pizzaBuilder = builder; Console.WriteLine("Chicken with Catupiry Pizza:"); director.prepareChickenAndCatupiry(); Console.WriteLine(builder.getPizza().ListParts()); Console.WriteLine("Four Cheeses Pizza:"); director.prepareFourCheese(); Console.WriteLine(builder.getPizza().ListParts()); }