Esempio n. 1
0
        }/*public void DeleteMealAtIndex(int a_index)*/

        /// <summary>
        /// Iterates through the meal list and deletes any meals that do not have a
        /// entree, side and beverage.
        /// </summary>
        /// <remarks>
        /// NAME: ClearEmptyMeals
        /// AUTHOR: Ryan Osgood
        /// DATE: 8/14/2019
        /// </remarks>
        public void ClearEmptyMeals()
        {
            for (int i = 0; i < m_customerOrders.Count; i++)
            {
                Meal target = GetMealAtIndex(i);
                if (!target.HasEntree() && !target.HasSide() && !target.HasBeverage())
                {
                    m_customerOrders.Remove(target);
                }
            }
        }/*public void ClearEmptyMeals()*/
Esempio n. 2
0
        }/*public SideView GetSideForDisplay()*/

        /// <summary>
        /// Firstly, check to see if the meal passed into this MealView has a Beverage. Depending
        /// on this, perform an action.
        /// </summary>
        /// <remarks>
        /// NAME: GetBeverageForDisplay
        /// AUTHOR: Ryan Osgood
        /// DATE: 8/15/2019
        /// </remarks>
        /// <returns>
        /// If the Meal has a Beverage, return a new BeverageView with the meal's Beverage passed into it. Else,
        /// return a new, empty BeverageView.
        /// </returns>
        public BeverageView GetBeverageForDisplay()
        {
            return(m_customerMeal.HasBeverage() ? new BeverageView(m_customerMeal.GetBeverage()) : new BeverageView(new Beverage()));
        }/*public BeverageView GetBeverageForDisplay()*/