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++; } }
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); }