Esempio n. 1
0
        static void Main(string[] args)
        {
            PizzaBuilder vBuilder;

            PizzaMaker maker = new PizzaMaker();

            vBuilder = new SpicyPizzaBuilder();

            maker.DoIt(vBuilder);
            Console.WriteLine(vBuilder.Pizza.ToString());

            vBuilder = new FourSeasonsPizzaBuilder();
            maker.DoIt(vBuilder);
            Console.WriteLine(vBuilder.Pizza.ToString());
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            PizzaBuilder hawaiianPizzaBuilder = new HawaiianPizzaBuilder();
            Cook         cook = new Cook();

            cook.SetPizzaBuilder(hawaiianPizzaBuilder);
            cook.ConstructPizza();
            // create the product
            Pizza hawaiian = cook.GetPizza();

            PizzaBuilder spicyPizzaBuilder = new SpicyPizzaBuilder();

            cook.SetPizzaBuilder(spicyPizzaBuilder);
            cook.ConstructPizza();
            // create another product
            Pizza spicy = cook.GetPizza();
        }