public void MakeMeal(MealBuilder mealBuilder) { mealBuilder.AddSandwich(); mealBuilder.AddSideOrder(); mealBuilder.AddDrink(); mealBuilder.AddOfferItem(); mealBuilder.SetPrice(); }
static void Main(string[] args) { MealBuilder mealBuilder = new MealBuilder(); var meal = mealBuilder.PrepareVegMeal(); Console.WriteLine("Cost" + meal.GetCost()); meal.ShowItems(); }
static void Main() { MealBuilder mb = (MealBuilder)XMLUtil.getBean(); KFCWaiter waiter = new KFCWaiter(); waiter.setMealBuilder(mb); Meal meal = waiter.construct(); Console.WriteLine("ÌײÍ×é³É£º"); Console.WriteLine(meal.getFood()); Console.WriteLine(meal.getDrink()); }
static void Main(string[] args) { MealBuilder mb = new MealBuilder(); Console.WriteLine("Veg meal"); Meal VegMeal = mb.prepareVegMeal(); Console.WriteLine("Cost: ", VegMeal.getCost()); Console.WriteLine("Non Veg meal"); Meal m = mb.prepareNonVegMeal(); Console.WriteLine("Cost: ", m.getCost()); }
static void Main(string[] args) { MealBuilder mealBuilder = new MealBuilder(); Meal vegMeal = mealBuilder.prepareVegMeal(); Console.WriteLine("Veg Meal"); vegMeal.showItems(); Console.WriteLine("Total cost: " + vegMeal.getCost()); Meal nonvegMeal = mealBuilder.prepareNonVegMeal(); Console.WriteLine("Veg Meal"); nonvegMeal.showItems(); Console.WriteLine("Total cost: " + nonvegMeal.getCost()); Console.ReadKey(); }
/// <summary> /// The Builder Demo /// Separates the construction of a complex object from its representation /// so that the same construction process can create different representations /// Great for Parsing data, building from a template and Making a burger! /// </summary> /// <param name="args"></param> static void Main(string[] args) { MealBuilder mealBuilder = new MealBuilder(); Meal vegMeal = mealBuilder.prepVeggieMeal(); Console.WriteLine("Vegetarian Meal"); vegMeal.showItems(); Console.WriteLine("Total Cost: ${0}", vegMeal.getCost()); Meal meatMeal = mealBuilder.prepMeatMeal(); Console.WriteLine("Meaty Meal"); meatMeal.showItems(); Console.WriteLine("Total Cost: ${0}", meatMeal.getCost()); Console.Read(); }
public static void Demo() { MealBuilder mealBuilder = new MealBuilder(); Meal vegMeal = mealBuilder.VegMeal(); Console.WriteLine("Veg Meal"); vegMeal.ShowItems(); Console.WriteLine("Total Cost: " + vegMeal.TotalCost()); Meal nonVegMeal = mealBuilder.NonVegMeal(); Console.WriteLine("\n\nNon-Veg Meal"); nonVegMeal.ShowItems(); Console.WriteLine("Total Cost: " + nonVegMeal.TotalCost()); Console.ReadLine(); }
static void Main(string[] args) { var builder = new MealBuilder(); var burgerMeal = builder.PrepareBurgerMeal(); Console.WriteLine("BurgerMeal : "); burgerMeal.ShowItems(); Console.WriteLine(burgerMeal.GetCost()); Console.WriteLine(); var chickenMeal = builder.PrepareChickenMeal(); Console.WriteLine("ChickenMeal : "); chickenMeal.ShowItems(); Console.WriteLine(chickenMeal.GetCost()); Console.ReadLine(); }
public void setMealBuilder(MealBuilder mb) { this.mb = mb; }