Beispiel #1
0
        public static Player scoreGame(Player player, int opponentRating, bool isWin)
        {
            //Set wins and losses
            if (isWin)
            {
                player.Wins = player.Wins + 1;
            }
            else
            {
                player.Losses = player.Losses + 1;
            }

            //Set OTR
            player.OpponentsTotalRating += opponentRating;

            //Set TGP
            player.TotalGamesPlayed = player.TotalGamesPlayed + 1;

            //Set Rating
            player.Rating = getRating(player);

            return player;
        }
Beispiel #2
0
 public static int getRating(Player player)
 {
     int r = ((1300 * 23) + player.OpponentsTotalRating + (400 * (player.Wins - player.Losses))) / (23 + player.TotalGamesPlayed);
     return r;
 }