public EloIndividualResult(EloPlayerIdentifier playerIdentifier, EloTeamIdentifier teamIdentifier, EloRating ratingBefore, EloRating ratingAfter)
 {
     PlayerIdentifier = playerIdentifier ?? throw new ArgumentNullException(nameof(playerIdentifier));
     TeamIdentifier   = teamIdentifier ?? throw new ArgumentNullException(nameof(teamIdentifier));
     RatingBefore     = ratingBefore;
     RatingAfter      = ratingAfter;
 }
Exemple #2
0
        public EloIndividualResult GetResult(EloPlayerIdentifier playerIdentifier)
        {
            var result = _results.FirstOrDefault(x => x.PlayerIdentifier == playerIdentifier);

            if (result == null)
            {
                throw new InvalidOperationException($"No player found in results with identifier {playerIdentifier}");
            }

            return(result);
        }
Exemple #3
0
 public int GetRatingAfter(EloPlayerIdentifier identifier)
 => GetResult(identifier).RatingAfter;
Exemple #4
0
 public int GetRatingDifference(EloPlayerIdentifier identifier)
 => GetResult(identifier).RatingDifference;
Exemple #5
0
 public EloPlayer(EloPlayerIdentifier identifier, int rating)
     : this(identifier, new EloRating(rating))
 {
 }
Exemple #6
0
 public EloPlayer(EloPlayerIdentifier identifier, EloRating rating)
 {
     Identifier = identifier ?? throw new ArgumentNullException(nameof(identifier));
     Rating     = rating ?? throw new ArgumentNullException(nameof(rating));
 }