Пример #1
0
        public void AddAsBestTime(PoolType poolType, EventDistance eventDistance, Stroke stroke, TimeSpan time)
        {
            int      id;
            TimeSpan bestTime = GetBestTime(poolType, stroke, eventDistance, out id);

            if (bestTime == new TimeSpan(1, 0, 0))
            {
                BestTimes[NoOfBestTimes] = new BestTime(poolType, eventDistance, stroke, time);
                NoOfBestTimes++;
            }
            else if (time < bestTime)
            {
                BestTimes[id].RecordTime = time;
            }
        }
Пример #2
0
        public void AddAsBestTime(PoolType poolType, EventDistance eventDistance, Stroke stroke, TimeSpan time)
        {
            TimeSpan bestTime = GetBestTime(poolType, stroke, eventDistance);

            if (bestTime == new TimeSpan(1, 0, 0))
            {
                BestTimes.Add(new BestTime(poolType, eventDistance, stroke, time));
            }
            else if (time < bestTime)
            {
                int      i    = BestTimes.IndexOf(new BestTime(poolType, eventDistance, stroke, bestTime));
                BestTime best = new BestTime(poolType, eventDistance, stroke, time);
                bestTimes[i] = best;
            }
        }