Esempio n. 1
0
 /// <summary>
 /// Sets all maximum goals.
 /// </summary>
 /// <param name="tracker">Tracker to set the goals on.</param>
 /// <param name="calorieGoal">calories value to set to</param>
 /// <param name="carb">carbs value to set to</param>
 /// <param name="fat">fat value to set to</param>
 /// <param name="protein">protein value to set to</param>
 public static void SetAllSettings(DailyTracker tracker, int calorieGoal, int carb, int fat, int protein)
 {
     SetCalorieGoal(tracker, calorieGoal);
     SetCarbGoal(tracker, carb);
     SetFatGoal(tracker, fat);
     SetProteinGoal(tracker, protein);
 }//end method
Esempio n. 2
0
        }//end method

        /// <summary>
        /// Set maximum fat
        /// </summary>
        /// <param name="tracker">tracker to set values on</param>
        /// <param name="fat">value to set to</param>
        /// <returns>true if setting succeeded, false if failed</returns>
        public static bool SetFatGoal(DailyTracker tracker, int fat)
        {
            if (fat >= MINIMUM_NUTRIENT_VALUE)
            {
                fatGoal = fat;
                tracker.SetFatGoal(fat);
                return(true);
            }
            else
            {
                return(false);
            }
        }//end method
Esempio n. 3
0
        }//end method

        /// <summary>
        /// Set maximum carbs
        /// </summary>
        /// <param name="tracker">tracker to set values on</param>
        /// <param name="carb">value to set to</param>
        /// <returns>true if setting succeeded, false if failed</returns>
        public static bool SetCarbGoal(DailyTracker tracker, int carb)
        {
            if (carb >= MINIMUM_NUTRIENT_VALUE)
            {
                carbGoal = carb;
                tracker.SetCarbsGoal(carb);
                return(true);
            }
            else
            {
                return(false);
            }
        }//end method
Esempio n. 4
0
        }//end method

        /// <summary>
        /// Set maximum calories
        /// </summary>
        /// <param name="tracker">tracker to set values on</param>
        /// <param name="cal">value to set to</param>
        /// <returns>true if setting succeeded, false if failed</returns>
        public static bool SetCalorieGoal(DailyTracker tracker, int cal)
        {
            if (cal >= MINIMUM_CALORIES)
            {
                calorieGoal = cal;
                tracker.SetCalorieGoal(cal);
                return(true);
            }
            else
            {
                return(false);
            }
        }//end method
Esempio n. 5
0
        }//end method

        /// <summary>
        /// Set maximum protein
        /// </summary>
        /// <param name="tracker">tracker to set values on</param>
        /// <param name="protein"></param>
        /// <returns>true if setting succeeded, false if failed</returns>
        public static bool SetProteinGoal(DailyTracker tracker, int protein)
        {
            if (protein >= MINIMUM_NUTRIENT_VALUE)
            {
                proteinGoal = protein;
                tracker.SetProteinGoal(protein);
                return(true);
            }
            else
            {
                return(false);
            }
        } //end method
Esempio n. 6
0
        }//end constructor

        /// <summary>
        /// Create a new Date object using values for year, month, and day.
        /// Creates a new empty DailyTracker for the date.
        /// </summary>
        /// <param name="year">Year of chosen date</param>
        /// <param name="month">Month of chosen date</param>
        /// <param name="day">Day of chosen date</param>
        public Date(int year, int month, int day)
        {
            this.date = new DateTime(year, month, day);
            tracker   = new DailyTracker();
        }//end constructor
Esempio n. 7
0
 /// <summary>
 /// Create a new Date object using a DateTime date.
 /// Creates a new empty DailyTracker for the date.
 /// </summary>
 /// <param name="date">DateTime object</param>
 public Date(DateTime date)
 {
     this.date = date;
     tracker   = new DailyTracker();
 }//end constructor