Пример #1
0
        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);
        }
Пример #2
0
 public Meal MealBuilder(MealBuilder builder)
 {
     builder.PrepareMeal();
     return(builder.GetMeal());
 }