Пример #1
0
        static void Main(string[] args)
        {
            var telePizzaPepOlives = new TelescopedPizza(Size.Medium, Cheese.Provolone, true, true, false, true);

            Logging.Log(telePizzaPepOlives);

            var telePizzaOlivesMushrooms = new TelescopedPizza(Size.Large, Cheese.Mozzarella, true, false, false, true, true);

            Logging.Log(telePizzaOlivesMushrooms);

            // Set Medium size, add Sauce, add Provolone cheese, add Pepperoni, add Olives, then build.
            var pizzaPepOlives = new PizzaBuilder(Size.Medium)
                                 .AddSauce()
                                 .AddCheese(Cheese.Provolone)
                                 .AddPepperoni()
                                 .AddOlives()
                                 .Build();

            Logging.Log(pizzaPepOlives);

            // Set Large size (default), add Sauce, add Mozzarella cheese (default), add Olives, add Mushrooms, then build it.
            var pizzaOlivesMushrooms = new PizzaBuilder()
                                       .AddSauce()
                                       .AddCheese()
                                       .AddOlives()
                                       .AddMushrooms()
                                       .Build();

            Logging.Log(pizzaOlivesMushrooms);
        }
Пример #2
0
        private static void Main(string[] args)
        {
            Console.WriteLine("Have a nice dinner with our delicious pizza!");
            PizzaBuilder  pizzaBuilder = new PizzaBuilder();
            PizzaDirector director     = new PizzaDirector(pizzaBuilder);

            Pizza margaritaPizza = director.CreateMargaritaPizza();
            Pizza pepperoniPizza = director.CreatePepperoniPizza();
            Pizza chickenPizza   = director.CreateChickenPizza();
        }
Пример #3
0
 public Pizza(PizzaBuilder builder)
 {
     Size      = builder.Size;
     Cheese    = builder.Cheese;
     Sauce     = builder.Sauce;
     Pepperoni = builder.Pepperoni;
     Ham       = builder.Ham;
     Olives    = builder.Olives;
     Mushrooms = builder.Mushrooms;
 }
Пример #4
0
        static void Main(string[] args)
        {
            IBuilder pizzaBuilder = new PizzaBuilder("PIZZA DE VERDURAS A LA PIEDRA");

            IPizza pizza = pizzaBuilder.CreateMasa(new MasaPiedra())
                           .CreateSalsa(new SalsaBlanca())
                           .CreateAdicional(new Acelga())
                           .CreateAdicional(new QuesoParmesano())
                           .Build();

            Pedido pedido = new Pedido(pizza);

            pedido.Print();
            Console.WriteLine(Environment.NewLine);
            Console.WriteLine("Presione una tecla para salir...");
            Console.ReadLine();
        }
Пример #5
0
        static void Main(string[] args)
        {
            /// example1
            IBuilderMobilePhone builderMobilePhone = new AndroidMobilePhone();
            DirectorMobilePhone mobilePhone        = new DirectorMobilePhone(builderMobilePhone);

            mobilePhone.Construction();
            Console.WriteLine(builderMobilePhone.GetMobilePhone().ToString());


            /// example2
            ICarBuilder carBuilder = new OpelConcreteBuilder();
            DirectorCar car        = new DirectorCar();

            car.Construction(carBuilder);
            Console.WriteLine(carBuilder.Car.ToString());


            /// example 3
            MesajDirector mesaj = new MesajDirector();

            mesaj.Construction(new DogumGunuTebrikBuilder());
            mesaj.Show();
            MesajBuilder builder = new BayramTebrikMesajBuilder();

            mesaj.Construction(builder);
            mesaj.Show();


            /// exampl4
            var pizzaOrder = new PizzaBuilder(Size.Medium)
                             .AddCheese()
                             .AddHam()
                             .AddMushrooms()
                             .AddOlives()
                             .AddPepperoni()
                             .AddSauce();

            Console.WriteLine("Size : {0}, Sauce : {1}, Pepperoni : {2}, Olives : {3}, Pepperoni : {4}, Ham : {5}", pizzaOrder.Size, pizzaOrder.Sauce, pizzaOrder.Pepperoni, pizzaOrder.Olives, pizzaOrder.Mushrooms, pizzaOrder.Ham);
            Console.ReadLine();
        }
Пример #6
0
 public void SetPizzaBuilder(PizzaBuilder pb)
 {
     pizzaBuilder = pb;
 }
Пример #7
0
 public void Olustur(PizzaBuilder vBuilder)
 {
     vBuilder.SosuHazirla();
     vBuilder.HamuruHazirla();
 }
Пример #8
0
 public void SetPizzaBuilder(PizzaBuilder inPizzaBuilder)
 {
     pizzaBuilder = inPizzaBuilder;
 }
Пример #9
0
 public void RecepcionarProximaPizza(PizzaBuilder pizzaBuilder)
 {
     _pizzaBuilder = pizzaBuilder;
 }
Пример #10
0
 public void SetPizzaBuilder(PizzaBuilder pizzaBuilder) => _pizzaBuilder = pizzaBuilder;