public void Bake(BreadBuilder breadBuilder) { breadBuilder.SetRyeFlour(); breadBuilder.SetWheatFlour(); breadBuilder.SetSalt(); breadBuilder.SetAddictives(); }
public static void Main() { var director = new Director(); var builder = new ConcreteBuilder(); director.Builder = builder; Console.WriteLine("Standard basic product:"); director.BuildMinimalViableProduct(); Console.WriteLine(builder.GetProduct().ListParts()); Console.WriteLine("Standard full featured product:"); director.BuildFullFeaturedProduct(); Console.WriteLine(builder.GetProduct().ListParts()); var breadBuilder = new BreadBuilder(); director.Builder = breadBuilder; Console.WriteLine("Standard basic product:"); director.BuildMinimalViableProduct(); Console.WriteLine(breadBuilder.GetProduct().ListParts()); Console.WriteLine("Standard full featured product:"); director.BuildFullFeaturedProduct(); Console.WriteLine(breadBuilder.GetProduct().ListParts()); Console.WriteLine("Custom product:"); builder.BuildPartA(); builder.BuildPartC(); Console.Write(builder.GetProduct().ListParts()); Console.ReadKey(); }
private void Bake(BreadBuilder builder) { var baker = new Baker(builder); baker.Bake(); Console.WriteLine(builder.Bread.ToString()); }
public static Bread Bake(BreadBuilder breadBuilder) { breadBuilder.CreateBread(); breadBuilder.SetFlour(); breadBuilder.SetSalt(); breadBuilder.SetAdditives(); return(breadBuilder.Bread); }
public Bread Bake(BreadBuilder builder) { builder.Bread = new Bread(); builder.SetFlour(); builder.SetSalt(); builder.SetAdditive(); return(builder.Bread); }
public Bread Bake(BreadBuilder breadBuilder) { breadBuilder.StartBake(); breadBuilder.AddFlour(); breadBuilder.AddYeast(); breadBuilder.AddAdditionals(); return(breadBuilder.Bread); }
public Baker(BreadBuilder builder) { _builder = builder; }