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); }
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(); }
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; }
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(); }
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(); }
public void SetPizzaBuilder(PizzaBuilder pb) { pizzaBuilder = pb; }
public void Olustur(PizzaBuilder vBuilder) { vBuilder.SosuHazirla(); vBuilder.HamuruHazirla(); }
public void SetPizzaBuilder(PizzaBuilder inPizzaBuilder) { pizzaBuilder = inPizzaBuilder; }
public void RecepcionarProximaPizza(PizzaBuilder pizzaBuilder) { _pizzaBuilder = pizzaBuilder; }
public void SetPizzaBuilder(PizzaBuilder pizzaBuilder) => _pizzaBuilder = pizzaBuilder;