Beispiel #1
0
        /// <summary>
        /// 新增飲料在點單中
        /// </summary>
        /// <param name="drink"></param>
        public void OrderDrink(Drink drink)
        {
            OrderedDrink orderedDrink = new OrderedDrink();

            orderedDrink.SetDrink(drink);
            _orderList.Add(orderedDrink);
        }
        /// <summary>
        /// 確認加料是否重複,若訂單沒飲料回傳false
        /// </summary>
        public bool IsAdditionOrdered(string name)
        {
            if (_drinkModel.GetOrderedDrink(_selectedDrinkIndex) == null)
            {
                return(false);
            }
            OrderedDrink drink = _drinkModel.GetOrderedDrink(_selectedDrinkIndex);

            return(drink.GetAdditionName().Contains(name));
        }