Пример #1
0
        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);
        }
Пример #2
0
        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);
        }
Пример #3
0
        //------------------------------------------------------------------------------------
        // Construction
        //------------------------------------------------------------------------------------

        public Ranking(TRankingType rankingType, SimpleTeam team)
        {
            RankingType = rankingType;
            Team        = team;
        }