protected IDictionary <long, Ranking> CalculateRankings() // MatchSubsystem.java / calculateRankings { IDictionary <long, Ranking> rankings = new Dictionary <long, Ranking>(); // key is team number TRankingType type = Ranking.GetType(Database.ThisEventMatchesPerTeam); foreach (var team in SimpleTeams) { rankings[team.TeamNumber] = new Ranking(type, team); } AddThisEventRankings(rankings); Ranking.SortRankings(rankings.Values, Environment.TickCount); return(rankings); }
protected static int GetTBPMatchesPlayed(TRankingType type, int matchesPlayed, int numDQedOrNoShow) { int eligibleToDrop = matchesPlayed - numDQedOrNoShow; int TBPMatchesPlayed; if (type != TRankingType.MORE_THAN_6 && (type != TRankingType.DEFAULT || matchesPlayed <= 6)) { TBPMatchesPlayed = matchesPlayed - Math.Min(eligibleToDrop, 1); } else { TBPMatchesPlayed = matchesPlayed - Math.Min(eligibleToDrop, 2); } TBPMatchesPlayed = Math.Max(1, TBPMatchesPlayed); return(TBPMatchesPlayed); }
//------------------------------------------------------------------------------------ // Construction //------------------------------------------------------------------------------------ public Ranking(TRankingType rankingType, SimpleTeam team) { RankingType = rankingType; Team = team; }