Exemplo n.º 1
0
        public EloTeamIdentifier AddTeam(EloTeam team)
        {
            if (team == null)
            {
                throw new ArgumentNullException(nameof(team));
            }

            if (!_teams.Add(team))
            {
                throw new ArgumentException($"Team with identifier {team.Identifier} already exists in this match.");
            }

            return(team.Identifier);
        }
Exemplo n.º 2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="team">Team to calculate expected score for.</param>
 /// <param name="opponentTeam">Opponent team to calculate expected score against.</param>
 /// <returns></returns>
 public static float ExpectedScoreAgainst(this EloTeam team, EloTeam opponentTeam)
 => ExpectedScore(team.Rating, opponentTeam.Rating);