/// <summary>
        /// Tries to delete the item at index: <paramref name="index"/> from the list
        /// </summary>
        public bool DeleteFoodScheduleItem(int index)
        {
            if (ValidateIndex(index))
            {
                FoodDescriptions.RemoveAt(index);
            }

            return(false);
        }
示例#2
0
        public FoodClass(int x, int y) : base(MapContent.FoodSpace, x, y)
        {
            healthPoints = Utils.rnd.Next(5, 101);

            Array values = Enum.GetValues(typeof(FoodKinds));

            kind        = (FoodKinds)values.GetValue(Utils.rnd.Next(values.Length));
            values      = Enum.GetValues(typeof(FoodDescriptions));
            description = (FoodDescriptions)values.GetValue(Utils.rnd.Next(values.Length));
        }
        /// <summary>
        /// Tries to add <paramref name="item"/> to the list
        /// </summary>
        public bool AddFoodScheduleItem(string item)
        {
            if (FoodDescriptions != null)
            {
                FoodDescriptions.Add(item);
                return(true);
            }

            return(false);
        }