예제 #1
0
        public static PizzaBuilder getInstance()
        {
            if (_instance == null)
            {
                _instance = new PizzaBuilder();
            }

            return(_instance);
        }
예제 #2
0
        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());
        }