public void AddResult(int raceNumber, RaceResult result) { if (!_results.ContainsKey(result.Entrant.Driver.Id)) { _results.Add(result.Entrant.Driver.Id, new DetailedDriverChampionshipResult(result.Entrant.Driver, _season)); } var championshipResult = _results[result.Entrant.Driver.Id]; championshipResult.AddResult(raceNumber, result); }
public DetailedChampionshipResult(ICompetitor competitor, Season season) { Competitor = competitor; Races = season.Races.Count(); Results = new RaceResult[Races]; for (var i = 0; i < Races; i++) { Results[i] = new NullRaceResult(competitor, season); } }
public override void AddResult(int raceNumber, RaceResult result) { if (result.Entrant.Driver.Id != Competitor.Id) return; if (raceNumber > Results.Length) return; Results[raceNumber - 1] = result; }
public abstract void AddResult(int raceNumber, RaceResult result);