Esempio n. 1
0
        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();
        }
Esempio n. 2
0
 public override void CreateSandwich()
 {
     _Sandwich            = new Sandwich();
     _Sandwich.BreadType  = Bread.White;
     _Sandwich.CheeseType = Cheese.Cheddar;
     _Sandwich.IsToasted  = false;
     _Sandwich.Vegetables.Add("Onion");
     _Sandwich.Vegetables.Add("Tomato");
 }
Esempio n. 3
0
 public override void CreateSandwich()
 {
     _Sandwich            = new Sandwich();
     _Sandwich.BreadType  = Bread.Brown;
     _Sandwich.CheeseType = Cheese.Mayo;
     _Sandwich.IsToasted  = true;
     _Sandwich.Vegetables.Add("Onion");
     _Sandwich.Vegetables.Add("Lettuce");
 }
Esempio n. 4
0
        static void Main(string[] args)
        {
            Console.WriteLine("---------------------------Club Sandwich------------------------------------");
            var      sandwichMaker = new SandwichMaker(new ClubSandwichBuilder());
            Sandwich clubSandwich  = sandwichMaker.MakeSandwich();

            clubSandwich.Display();

            Console.WriteLine("---------------------------Standard Sandwich------------------------------------");
            sandwichMaker = new SandwichMaker(new StandardSandwichBuilder());
            Sandwich standardSandwich = sandwichMaker.MakeSandwich();

            standardSandwich.Display();

            Console.ReadLine();
        }
 public void CreateSandwich()
 {
     this.sandwich = new Sandwich();
 }
Esempio n. 6
0
 public void CreateSandwich()
 {
     sandwich = new Sandwich();
 }
 public void CreateSandwich()
 {
     this.sandwich = new Sandwich();
 }
Esempio n. 8
0
 public HamAndCheese()
 {
     sandwich = new Sandwich("Ham and Cheese");
 }
Esempio n. 9
0
 public BLT()
 {
     sandwich = new Sandwich("BLT");
 }
Esempio n. 10
0
 public TurkeyClub()
 {
     sandwich = new Sandwich("Turkey Club");
 }