Example #1
0
 /// <summary>
 /// 用drinkIndex找要加"加料"的飲料,把加料加進去
 /// </summary>
 /// <param name="drinkIndex"></param>
 /// <param name="addition"></param>
 public bool AddDrinkAddition(int drinkIndex, DrinkAddition addition)
 {
     if (drinkIndex < _orderList.Count && drinkIndex >= 0)
     {
         return(_orderList[drinkIndex].AddAddition(addition));
     }
     return(false);
 }
Example #2
0
        /// <summary>
        /// 增加加料
        /// </summary>
        /// <param name="addition"></param>
        public bool AddAddition(DrinkAddition addition)
        {
            string totalAddition = GetAdditionName();

            if (totalAddition.Contains(addition.Name))
            {
                return(false);
            }
            _additionList.Add(addition);
            return(true);
        }
Example #3
0
 //Add Drink
 public void AddDrinkAddition(DrinkAddition addition)
 {
     _drinkAddition.Add(addition);
     _totalPrice += addition.price;
 }
Example #4
0
 //Remove Addition
 public void RemoveAddition(DrinkAddition addition)
 {
     _drinkAddition.RemoveAll(item => object.ReferenceEquals(item, addition));
 }