Example #1
0
        public static void Run()
        {
            var pizzaBuilder = new PizzaBuilder();
            var pizza        = pizzaBuilder
                               .SetCrust(Crust.Regular)
                               .SetSauce(Sauce.BBQ)
                               .AddTopping(Topping.GreenPeppers)
                               .AddTopping(Topping.Olives)
                               .MakePizza();

            Console.WriteLine("Pizza ingredients:");
            Console.WriteLine("Crust: " + pizza.Crust);
            Console.WriteLine("Sauce: " + pizza.Sauce);
            Console.Write("Toppings: ");
            foreach (Topping t in pizza.Toppings)
            {
                Console.Write(t + " ");
            }
            Console.WriteLine();
        }
Example #2
0
 public void SetPizzaBuilder(PizzaBuilder pb)
 {
     _pizzaBuilder = pb;
 }
Example #3
0
 public void SetPizzaBuilder(PizzaBuilder pb)
 {
     _pizzaBuilder = pb;
 }