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); }
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"); }
static void Main(string[] args) { HamburgerFactory hamburgerFactory = new HamburgerFactory(); List <Hamburger> menu = new List <Hamburger>(); menu.Add(hamburgerFactory.CreateHamburger("Veg")); menu.Add(hamburgerFactory.CreateHamburger("VegLettuce")); menu.Add(hamburgerFactory.CreateHamburger("Cheese")); menu.Add(hamburgerFactory.CreateHamburger("CheeseOnion")); Console.WriteLine("Welcome to my Hamburger Factory"); Console.WriteLine("This is the menu:"); foreach (Hamburger hamb in menu) { Console.WriteLine(hamb.ToString()); } }
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()); }