コード例 #1
0
ファイル: Calculations.cs プロジェクト: aspenryd/NRanking
 public int CalculateRankingDiff(Player blackPlayer, Player whitePlayer, int blackScore, int whiteScore)
 {
     var diff = CalculateRankingDiff(blackPlayer.CurrentRanking, whitePlayer.CurrentRanking, blackScore, whiteScore);
     blackPlayer.RankDiff += diff;
     whitePlayer.RankDiff -= diff;
     return diff;
 }
コード例 #2
0
ファイル: EloFile.cs プロジェクト: aspenryd/NRanking
 private void ParsePlayerLine(string line)
 {
     if (_status != EloFileReadStatus.Players) throw new ParsingExeption(string.Format("Trying to parse player line while having wrong status:{0} - read line {1}", _status, line));
     //%_%    5198, VAN DEN BERG, Erwin, NL,  7, 393
     line = PartToString(line, 4);
     if (line.StartsWith("+"))
         line = PartToString(line, 2);
     var values = line.Split(',');
     var player = new Player
                      {
                          PlayerId = ConvertToInt(values[0]),
                          LastName = values[1].Trim(),
                          FirstName = values[2].Trim(),
                          Country = new Country(values[3].Trim())
                      };
     Tournament.Players.Add(player);
     var tournamentResult = new TournamentResult
                                {
                                    PlayerId = player.PlayerId,
                                    Points = ConvertToDouble(values[4]),
                                    Mbq = ConvertToDouble(values[5])
                                };
     Tournament.Results.Add(tournamentResult);
 }
コード例 #3
0
ファイル: Calculations.cs プロジェクト: aspenryd/NRanking
 public int CalculateRankingDiff(Player blackPlayer, Player whitePlayer, int blackScore)
 {
     return CalculateRankingDiff(blackPlayer, whitePlayer, blackScore, 64-blackScore);
 }