Exemplo n.º 1
0
        public void Test()
        {
            int elo;

            elo = EloCalculator.CalculateNewElo(2000, 2000, 0, EloCalculator.VictoryType.Win);
            Assert.AreEqual(elo, 2020);

            elo = EloCalculator.CalculateNewElo(1970, 2320, 35, EloCalculator.VictoryType.Loss);
            Assert.AreEqual(elo, 1968);

            elo = EloCalculator.CalculateNewElo(2480, 2100, 482, EloCalculator.VictoryType.Loss);
            Assert.AreEqual(elo, 2471);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Changes the rating of the Pokemon based on a game.
 /// </summary>
 /// <param name="opponent">Opponent played.</param>
 /// <param name="victoryType">Whether the Pokemon won.</param>
 public void ChangeRating(Pokemon opponent, EloCalculator.VictoryType victoryType)
 {
     _rating = EloCalculator.CalculateNewElo(Rating, opponent.Rating, GamesPlayed, victoryType);
 }