static void Main(string[] args) { Sandwich sandwich = Sandwich.Builder() .Size(Size.XL) .Sauce(Sauce.Ketchup) .Meat(Meat.Chicken) .WithCheese(true) .IsSpicy(true) .IsCold(false) .Build(); Console.WriteLine(sandwich); Console.ReadKey(); }
static void Main(string[] args) { Console.WriteLine("Hello World!"); SandwichDirector sandwichDirector = new SandwichDirector(new MySandwichBuilder()); sandwichDirector.buildSandwich(); Sandwich sandwich1 = sandwichDirector.getSandwhich(); sandwich1.display(); SandwichDirector sandwichDirector2 = new SandwichDirector(new ClubSandwichBuilder()); sandwichDirector2.buildSandwich(); Sandwich sandwich2 = sandwichDirector2.getSandwhich(); sandwich2.display(); }
public void CreateSandwich() { Sandwich = new Sandwich(); }
public void CreateNewSandwich() { sandwich = new Sandwich(); }
public BLT() { sandwich = new Sandwich("BLT"); }
public TurkeyClub() { sandwich = new Sandwich("Turkey Club"); }
public HamAndCheese() { sandwich = new Sandwich("Ham and Cheese"); }
public void CreateNewSandwich() { this.sandwitch = new Sandwich(); }