static void Main(string[] args) { var builder = new SandwichBuilder() .WithMeat() .WithCheeseChedar() .WithMayoMustard(); }
public void Assemble(SandwichBuilder sandwichBuilder) { sandwichBuilder.AddBread(); sandwichBuilder.AddMeats(); sandwichBuilder.AddCheese(); sandwichBuilder.AddVeggies(); sandwichBuilder.AddCondiments(); }
public Sandwich ConstructSandwich(SandwichBuilder sandwichBuilder) { sandwichBuilder.CreateNewSandwich(); sandwichBuilder.SetSandwichType(); sandwichBuilder.AddCondiments(); sandwichBuilder.AddMeat(); sandwichBuilder.AddVeggies(); sandwichBuilder.PrepareSandwich(); return(sandwichBuilder.GetSandwich()); }
private SandwichMaker(SandwichType sandwichTyp, bool hasMayo, bool hasMustard) { switch (sandwichTyp) { case SandwichType.Bauru: _builder = new BauruSandwichBuilder(); break; case SandwichType.Chacarero: _builder = new ChacareroSandwichBuilder(); break; case SandwichType.Jambon: _builder = new JambonBeurreSandwichBuilder(); break; default: _builder = null; break; } _hasMayo = hasMayo; _hasMustard = hasMustard; }
public SandwichMaker(SandwichBuilder builder) { _builder = builder; }
public SandwichDirector(SandwichBuilder builder) { this.builder = builder; }
public void ChangeBuilder(SandwichBuilder newBuilder) { _builder = newBuilder; }
public SandwichMaker(SandwichBuilder builder) { this.builder = builder; }
public SandwichDirector(SandwichBuilder builder) => _builder = builder;
public SandwichAssembly(SandwichBuilder sadwichBuilder) { _sadwichBuilder = sadwichBuilder; }
public void Make(SandwichBuilder sandwichBuilder) { sandwichBuilder.AddBread(); sandwichBuilder.AddFilling(); sandwichBuilder.AddSauce(); }