コード例 #1
0
        public QuickMeal PrepareVegMeal()
        {
            QuickMeal meal = new QuickMeal();

            meal.AddItem(new VegBurger());
            meal.AddItem(new Coke());
            return(meal);
        }
コード例 #2
0
        public QuickMeal PrepareChickenMeal()
        {
            QuickMeal meal = new QuickMeal();

            meal.AddItem(new ChickenBurger());
            meal.AddItem(new Pepsi());
            return(meal);
        }
コード例 #3
0
        static void Main(string[] args)
        {
            QuickMealBuilder mealBuilder = new QuickMealBuilder();

            Console.WriteLine("-=-=-=-=-=-=-=-=-=-=-=-=-");
            QuickMeal vegMeal = mealBuilder.PrepareVegMeal();

            Console.WriteLine("Veg Meal");
            vegMeal.ShowItems();
            Console.WriteLine("Total Price:" + vegMeal.GetPrice());

            Console.WriteLine("-=-=-=-=-=-=-=-=-=-=-=-=-");
            QuickMeal chickenMeal = mealBuilder.PrepareChickenMeal();

            Console.WriteLine("Chicken Meal");
            chickenMeal.ShowItems();
            Console.WriteLine("Total Price:" + chickenMeal.GetPrice());

            Console.ReadLine();
        }