Example #1
0
        static void Main(string[] args)
        {
            //List<HamburgerBuilder> menu = new List<HamburgerBuilder>();
            //menu.Add(new VeggHamburgerBuilder());
            //menu.Add(new VeggHambBuilderLettuce());

            //Hamburger hamb = PrepareHamburger(menu[0]);

            Dictionary <string, Hamburger> menu = new Dictionary <string, Hamburger>();
            FactoryHamburger hamburgerFactory   = new FactoryHamburger();

            Hamburger veggNormalHam = hamburgerFactory.CreateHamburger("VeggNormalHamburger");

            menu.Add("Normal Veggeterian Hamberger", veggNormalHam);
            Hamburger vegglHamWithLettuce = hamburgerFactory.CreateHamburger("VeggHamburgerWithLettuce");

            menu.Add("Veggeterian with lettuce", vegglHamWithLettuce);
            Hamburger cheeseNormalHam = hamburgerFactory.CreateHamburger("CheeseNormalHamburger");

            menu.Add("Normal Cheese hamburger", cheeseNormalHam);
            Hamburger cheeseHamWithLettuce = hamburgerFactory.CreateHamburger("CheeseHamburgerWithOnion");

            menu.Add("Cheese hamburger with onion", cheeseHamWithLettuce);

            foreach (KeyValuePair <string, Hamburger> currPairNameAndHamburger in menu)
            {
                Console.WriteLine(currPairNameAndHamburger.Key + ": ");
                Console.WriteLine(currPairNameAndHamburger.Value);
            }
        }
Example #2
0
        static void Main(string[] args)
        {
            List <HamburgerBuilder> menu = new List <HamburgerBuilder>();

            menu.Add(new VeggHamburgerBuilder());
            menu.Add(new MeatburgerBuilder());
            menu.Add(new VeggHambBuilderLettuce());

            Hamburger hamb = PrepareHamburger(menu[2]);

            Console.WriteLine(hamb);

            //////////////////////////////////////////////////////////////

            HumburgerFactory factory = new HumburgerFactory();

            List <Hamburger> hums = new List <Hamburger>();

            hums.Add(factory.createHamburger("veg"));
            hums.Add(factory.createHamburger("meat"));

            foreach (var hum in hums)
            {
                Console.WriteLine(hum);
            }
        }
Example #3
0
        static void Main(string[] args)
        {
            List <HamburgerBuilder> menu = new List <HamburgerBuilder>();

            menu.Add(new VeggHamburgerBuilder());
            menu.Add(new MeatburgerBuilder());
            menu.Add(new VeggHambBuilderLettuce());

            Hamburger hamb = PrepareHamburger(menu[0]);

            //////////////////////////////////////////////////////////////

            HumburgerFactory factory = new HumburgerFactory();

            Hamburger hums1 = new Hamburger();

            hums1 = factory.createHamburger("veg");

            Console.WriteLine(hums1);


            Hamburger hums2 = new Hamburger();

            hums2 = factory.createHamburger("meat");

            Console.WriteLine(hums2);
        }
Example #4
0
        static void Main(string[] args)
        {
            List <HamburgerBuilder> menu = new List <HamburgerBuilder>();

            menu.Add(new VeggieLightBuilder());
            menu.Add(new VeggHambBuilderLettuce());

            Hamburger hamb = PrepareHamburger(BurgerBuilderFactoty.createHamburger("Veg"));
        }
Example #5
0
        static void Main(string[] args)
        {
            List <HamburgerBuilder> menu = new List <HamburgerBuilder>();

            menu.Add(new VeggHamburgerBuilder());
            menu.Add(new VeggHambBuilderLettuce());

            Hamburger hamb = PrepareHamburger(menu[0]);
        }
Example #6
0
 public void BuildHamburger()
 {
     this.hamburger = new Hamburger();
     PrepareBun();
     PrepareVegg();
     PrepareMain();
     PrepareTopping();
     PreparePriceLabel();
 }
Example #7
0
        static void Main(string[] args)
        {
            HamburgerFactory factory                 = new HamburgerFactory();
            Hamburger        crispyChicken           = factory.getHamburger("Crispy Chicken");
            Hamburger        crispyChickenWithTamato = factory.getHamburger("Crispy Chicken With Tomato");
            Hamburger        VeggyBurger             = factory.getHamburger("Veggy Burger");
            Hamburger        VeggyBurgerWithLettuce  = factory.getHamburger("Veggy Burger With Lettuce");

            Console.WriteLine(crispyChicken);
        }
Example #8
0
        static void Main(string[] args)
        {
            List <HamburgerBuilder> menu = new List <HamburgerBuilder>();

            menu.Add(new VeggHamburgerBuilder());
            menu.Add(new VeggHambBuilderLettuce());

            Hamburger hamb = PrepareHamburger(menu[0]);

            HamburgerFactory bf       = new HamburgerFactory();
            Hamburger        veg      = bf.createBurger("veggie");
            Hamburger        burger   = bf.createBurger("susu");
            Hamburger        veglight = bf.createBurger("veggie light");
        }
Example #9
0
        static void Main(string[] args)
        {
            List <HamburgerBuilder> menu = new List <HamburgerBuilder>();

            menu.Add(new VeggHamburgerBuilder());
            menu.Add(new VeggHambBuilderLettuce());
            menu.Add(new DoubleHamburgerBuilder());

            Hamburger hamb  = PrepareHamburger(menu[0]);
            Hamburger hamb2 = PrepareHamburger(menu[2]);

            Console.WriteLine(hamb2.ToString());

            HamburgerFactory fac = new HamburgerFactory();

            fac.Create("Double");
            Console.WriteLine(fac.ToString());
        }
Example #10
0
        static void Main(string[] args)
        {
            List <HamburgerBuilder> menu = new List <HamburgerBuilder>();

            menu.Add(new VeggHamburgerBuilder());
            menu.Add(new VeggHambBuilderLettuce());
            menu.Add(new SusuBuilder());
            menu.Add(new SusuBuilderLettuce());

            Hamburger hamb = PrepareHamburger(menu[0]);

            // Burger Factory
            BurgerFactory bFactory = new BurgerFactory();

            Hamburger v  = bFactory.CreateBurger("veggie");
            Hamburger vl = bFactory.CreateBurger("veggie lettuce");
            Hamburger s  = bFactory.CreateBurger("susu");
            Hamburger sl = bFactory.CreateBurger("susu lettuce");
        }