Example #1
0
        public void AddRaceLap(Guid raceId, TRaceLap lap)
        {
            var raceLaps = laps[raceId];

            raceLaps.Add(lap);

            calculatedLaps[raceId] = calculator.CalculateLaps(distance, raceLaps.Presented().Cast <IReadOnlyActiveRaceLap>()).ToList();
        }
Example #2
0
        public HeatState(IDistance distance, Heat number, IEnumerable <TRace> races, IDistanceDisciplineCalculator calculator)
        {
            this.distance   = distance;
            this.calculator = calculator;

            Number = number;
            Races  = races.ToList();

            foreach (var race in Races)
            {
                laps.Add(race.RaceId, race.Laps.ToList());
                calculatedLaps.Add(race.RaceId, calculator.CalculateLaps(distance, race.Laps.Presented().Cast <IReadOnlyActiveRaceLap>()).ToList());
                passings.Add(race.RaceId, race.Passings.ToList());
                nextLapIndices.Add(race.RaceId, 0);
            }
        }