Esempio 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)
        {
            AthleteSeasonDetails athlete = Athletes.Find(a => a.Key == key);

            if (athlete == null)
            {
                return;
            }

            athlete.AddNewTime(newTime);
        }
Esempio n. 2
0
        /// <summary>
        /// Update the points earnt for position for the indicated athlete on the indicated date.
        /// </summary>
        /// <param name="key">unique key</param>
        /// <param name="date">date of the event</param>
        /// <param name="points">earned points</param>
        public void UpdatePositionPoints(int key, DateType date, int points)
        {
            AthleteSeasonDetails athlete = Athletes.Find(a => a.Key == key);

            if (athlete == null)
            {
                return;
            }

            athlete.UpdatePositionPoints(date, points);
        }
Esempio n. 3
0
        /// <summary>
        /// Add a new time to the indicated (key) athlete.
        /// </summary>
        /// <param name="key">unique key</param>
        /// <param name="points">new points to add</param>
        public void AddNewPoints(
            int key,
            CommonPoints points)
        {
            AthleteSeasonDetails athlete = Athletes.Find(a => a.Key == key);

            if (athlete == null)
            {
                return;
            }

            athlete.AddNewPoints(points);
            this.AthletesChangedEvent?.Invoke(this, new EventArgs());
        }
Esempio n. 4
0
File: Season.cs Progetto: abs508/jHc
        /// <summary>
        /// Create and add a new athlete to the athletes list. Save the list.
        /// </summary>
        /// <param name="key">athlete key</param>
        /// <param name="name">athlete name</param>
        /// <param name="runningNumbers">athlete running numbers</param>
        /// <param name="handicap">athlete handicap</param>
        /// <param name="firstTimer">first timer flag</param>
        public void AddNewAthlete(
            int key,
            string name,
            string handicap,
            bool firstTimer)
        {
            AthleteSeasonDetails newAthlete =
                new AthleteSeasonDetails(
                    key,
                    name);

            Athletes.Add(newAthlete);

            this.athleteData.SaveAthleteSeasonData(Name, Athletes);

            this.AthletesChangedEvent?.Invoke(this, new EventArgs());
            this.AthleteCollectionChangedEvent?.Invoke(this, EventArgs.Empty);
        }
Esempio n. 5
0
        /// <summary>
        /// Create and add a new athlete to the athletes list. Save the list.
        /// </summary>
        /// <param name="key">athlete key</param>
        /// <param name="name">athlete name</param>
        /// <param name="runningNumbers">athlete running numbers</param>
        /// <param name="handicap">athlete handicap</param>
        /// <param name="firstTimer">first timer flag</param>
        public void AddNewAthlete(
            int key,
            string name,
            string handicap,
            bool firstTimer)
        {
            AthleteSeasonDetails newAthlete =
                new AthleteSeasonDetails(
                    key,
                    name,
                    this.resultsConfigurationManager);

            Athletes.Add(newAthlete);

            this.athleteData.SaveAthleteSeasonData(Name, Athletes);

            this.AthletesChangedEvent?.Invoke(this, new EventArgs());
        }