コード例 #1
0
 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);
 }
コード例 #2
0
 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);
     }
 }
コード例 #3
0
 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;
 }
コード例 #4
0
 public abstract void AddResult(int raceNumber, RaceResult result);