public static void TestBuilderPattern() { MealDirector director = new MealDirector(); string order = "pizza"; MealBuilder mealBuilder = null; if (order == "pizza") { mealBuilder = new PizzaBuilder(); } else if (order == "burger") { mealBuilder = new BurgerBuilder(); } Meal meal = director.MealBuilder(mealBuilder); }
public Meal MealBuilder(MealBuilder builder) { builder.PrepareMeal(); return(builder.GetMeal()); }