Exemplo n.º 1
0
        /// <summary>
        /// Add a new time to the indicated (key) athlete.
        /// </summary>
        /// <param name="key">unique key</param>
        /// <param name="newTime">new time to add</param>
        public void AddNewTime(int key, Appearances newTime)
        {
            AthleteDetails athlete = AthleteDetails.Find(a => a.Key == key);

            if (athlete == null)
            {
                return;
            }

            athlete.AddRaceTime(newTime);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Uses the key to identify the athlete then checks to see how many events have been
        /// completed. If zero then the athlete is a first timer, return true.
        /// </summary>
        /// <param name="key">unique key</param>
        /// <returns>true if a first timer.</returns>
        public bool IsFirstTimer(int key)
        {
            AthleteDetails athlete = AthleteDetails.Find(a => a.Key == key);

            if (athlete == null)
            {
                return(false);
            }

            return(athlete.Appearances == 0);
        }
Exemplo n.º 3
0
 /// <summary>
 ///   Adds a new athlete to the list
 /// </summary>
 /// <param name="details">new athlete's details</param>
 public void SetNewAthlete(AthleteDetails details)
 {
     this.AthleteDetails.Add(details);
     this.SetNextKey();
 }