Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            PizzaDirector pizzaDirector        = new PizzaDirector();
            IPizzaBuilder peperoniPizzaBuilder = new PeperoniPizzaBuilder();
            IPizzaBuilder hawaiPizzaBuilder    = new HawaiPizzaBuilder();

            pizzaDirector.MakePizza(hawaiPizzaBuilder);
            Console.WriteLine(hawaiPizzaBuilder.Pizza.Name + "\n[RECIPIE]:");
            hawaiPizzaBuilder.ShowIngredients();
            Console.WriteLine();
            pizzaDirector.MakePizza(peperoniPizzaBuilder);
            Console.WriteLine(peperoniPizzaBuilder.Pizza.Name + "\n[RECIPIE]:");
            peperoniPizzaBuilder.ShowIngredients();

            Console.ReadKey();
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            Cocina       cocina               = new Cocina();
            PizzaBuilder hawai_pizzabuilder   = new HawaiPizzaBuilder();
            PizzaBuilder picante_pizzabuilder = new PicantePizzaBuilder();

            Console.WriteLine("Con Hawai:");
            cocina.setPizzaBuilder(hawai_pizzabuilder);
            cocina.construirPizza();
            Pizza pizza = cocina.getPizza();

            Console.WriteLine("Con Picante:");
            cocina.setPizzaBuilder(picante_pizzabuilder);
            cocina.construirPizza();
            Pizza pizza2 = cocina.getPizza();

            Console.ReadKey();
        }