public static void Main(string[] args) { //Sandwich sandwich = new Sandwich(Sandwich.BreadType.Wheat, Sandwich.CheeseType.American, true, false, true, new List<string> { "Tomato", "Lettuce" }); //Sandwich kidSandwich = new Sandwich(); //kidSandwich.Bread = BuilderPattern.Sandwich.BreadType.Wheat; //kidSandwich.Cheese = BuilderPattern.Sandwich.CheeseType.Parmesan; //kidSandwich.HasMayo = true; //kidSandwich.HasMustard = false; //kidSandwich.IsToasted = true; //kidSandwich.Vegetables = new List<string> { "Tomato", "Lettuce", "Olives" }; //kidSandwich.Display(); //sandwich.Display(); //SandwichBuilder builder = new ClubSandwichBuilder(); //builder.CreateSandwich(); //Sandwich sandwich = builder.GetSandwich(); SandwichMaker maker = new SandwichMaker(new ClubSandwichBuilder()); maker.BuildSandwich(); Sandwich sandwich = maker.GetSandwich(); sandwich.Display(); }
static void Main(string[] args) { var sandwichMaker = new SandwichMaker(new MySandwichBuilder()); sandwichMaker.BuildSandwich(); var sandwich1 = sandwichMaker.GetSandwich(); var sandwichMaker2 = new SandwichMaker(new ClubSandwichBuilder()); sandwichMaker2.BuildSandwich(); var sandwich2 = sandwichMaker.GetSandwich(); sandwich1.Display(); Console.WriteLine("\n********************************\n"); sandwich2.Display(); Console.ReadKey(); }
static void Main(string[] args) { var sandwichMaker = new SandwichMaker(new MySandwichBuilder()); sandwichMaker.BuildSandwich(); var sandwich1 = sandwichMaker.GetSandwich(); sandwich1.Display(); var sandwichMaker2 = new SandwichMaker(new ClubSandwichBuilder()); sandwichMaker2.BuildSandwich(); var sandwich2 = sandwichMaker2.GetSandwich(); sandwich2.Display(); ReadKey(); }
static void Main(string[] args) { //new Sandwich1(BreadType.Wheat, false, CheesType.American, MeatType.Turkey, false, false, // new List<string> {"Tomato"}).Display(); //var sandwich = new Sandwich(); //sandwich.BreadType= BreadType.Wheat; //sandwich.MeatType= MeatType.Turkey; //sandwich.CheesType=CheesType.American; //sandwich.HasMayo = false; //sandwich.HasMustard = false; //sandwich.HasMustard = true; //sandwich.Vegetables = new List<string> {"Tomato", "Onion"}; //sandwich.Display(); //var builder = new MySandwichBuilder(); //builder.CreateSandwich(); //var sandwich = builder.GetSandwich(); //sandwich.Display(); var maker = new SandwichMaker(new MySandwichBuilder()); maker.BuildSandwich(); var sandwich = maker.GetSandwich(); sandwich.Display(); var maker2 = new SandwichMaker(new ClubSandwichBuilder()); maker2.BuildSandwich(); var sandwich2 = maker2.GetSandwich(); sandwich2.Display(); Console.ReadKey(); }