Esempio n. 1
0
 double VictoryProbability(Elo opponent)
 {
     return 1.0 / (1.0 + Math.Pow(10, (opponent.Rating - rating) / 400.0));
 }
Esempio n. 2
0
 internal void Victory(Elo opponent)
 {
     int eloDiff = ComputeEloDiff(1, opponent);
     rating += eloDiff;
     opponent.Rating -= eloDiff;
 }
Esempio n. 3
0
 private int ComputeEloDiff(double matchResult, Elo opponent)
 {
     return Convert.ToInt32(K * (matchResult - VictoryProbability(opponent)));
 }
Esempio n. 4
0
 internal void Null(Elo opponent)
 {
     int eloDiff = ComputeEloDiff(0.5, opponent);
     rating += eloDiff;
     opponent.Rating -= eloDiff;
 }
Esempio n. 5
0
 internal void Defeat(Elo opponent)
 {
     int eloDiff = ComputeEloDiff(0, opponent);
     rating += eloDiff;
     opponent.Rating -= eloDiff;
 }
Esempio n. 6
0
 public Player(string name)
     : base(name)
 {
     MatchsIds = new ObservableCollection<MatchID>();
     Elo = new Elo();
 }
Esempio n. 7
0
 public Player()
 {
     Elo = new Elo();
 }
Esempio n. 8
0
 public PlayerRank(string name)
 {
     Elo = new Elo();
 }