Ejemplo 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(); 
        }
Ejemplo n.º 2
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();
        }
Ejemplo n.º 3
0
        static void Main(string[] args)
        {
            var clubsandwichBuilder = new ClubSandwichBuilder();
            var sandwichMaker       = new SandwichMaker(clubsandwichBuilder);

            var sandwich = sandwichMaker.BuildSandwich();

            sandwich.Display();
        }
Ejemplo 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();
        }
Ejemplo n.º 5
0
        static void Main(string[] args)
        {
            var sandwichMaker = new SandwichMaker(new MySandwichBuilder());

            sandwichMaker.BuildSandwich();
            var sandwich1 = sandwichMaker.GetSandwhich();

            sandwich1.Display();

            var sandwichMaker2 = new SandwichMaker(new ClubSandwichBuilder());

            sandwichMaker2.BuildSandwich();
            var sandwich2 = sandwichMaker2.GetSandwhich();

            sandwich2.Display();
            Console.ReadKey();
        }
Ejemplo n.º 6
0
        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();
        }