コード例 #1
0
 public void AddMatch(Match.Points points) // TO-DO: Improve this method
 {
     if (points == Match.Points.WIN)
     {
         this.MatchesWon++;
     }
     else if (points == Match.Points.LOSS)
     {
         this.MatchesLost++;
     }
     else
     {
         this.MatchesDrawn++;
     }
 }
コード例 #2
0
 private static Dictionary <string, Team> UpdateTeam(this Dictionary <string, Team> teams, string name, Match.Points points)
 {
     teams.TryGetValue(name, out var team);
     (team ??= new Team {
         Name = name
     }).AddMatch(points);
     teams[name] = team;
     return(teams);
 }