Esempio n. 1
0
        TimeSpan?getAccumulatedTime(RaceRun rr, RunResultWithPosition resWp)
        {
            Race race = rr.GetRace();

            TimeSpan?ts = new TimeSpan();

            for (int i = 0; i < race.GetMaxRun(); i++)
            {
                RaceRun r = race.GetRun(i);
                if (r.Run <= rr.Run)
                {
                    TimeSpan?t = r.GetRunResult(resWp.Participant)?.Runtime;
                    if (t != null && ts != null)
                    {
                        ts = ts + (TimeSpan)t;
                    }
                    else
                    {
                        ts = null;
                    }
                }
            }

            return(ts);
        }