private void DoPlayoffs()
        {
            List <Team> teams = GetTop6Teams();

            teams.ForEach(x => x.MadePlayoffs = true);

            var quarterFinalResult1 = Team.PlayGame(teams[2], teams[5], RoundType.Playoff, true);
            var quarterFinalResult2 = Team.PlayGame(teams[3], teams[4], RoundType.Playoff, true);

            var semiFinalResult1 = Team.PlayGame(teams[0], quarterFinalResult1.WinningTeam, RoundType.Playoff, true);
            var semiFinalResult2 = Team.PlayGame(teams[1], quarterFinalResult2.WinningTeam, RoundType.Playoff, true);

            var finalsResult      = Team.PlayGame(semiFinalResult1.WinningTeam, semiFinalResult2.WinningTeam, RoundType.Playoff, true);
            var bronzeMedalResult = Team.PlayGame(semiFinalResult1.LosingTeam, semiFinalResult2.LosingTeam, RoundType.Playoff, true);

            finalsResult.WinningTeam.FinalRanking       = 1;
            finalsResult.LosingTeam.FinalRanking        = 2;
            bronzeMedalResult.WinningTeam.FinalRanking  = 3;
            bronzeMedalResult.LosingTeam.FinalRanking   = 4;
            quarterFinalResult1.LosingTeam.FinalRanking = 5;
            quarterFinalResult2.LosingTeam.FinalRanking = 6;

            var playoffResults = new System.Collections.Generic.Dictionary <PlayoffRoundType, List <Game> >();

            playoffResults.Add(PlayoffRoundType.Quarters, new List <Game>(new Game[] { quarterFinalResult1, quarterFinalResult2 }));
            playoffResults.Add(PlayoffRoundType.Semis, new List <Game>(new Game[] { semiFinalResult1, semiFinalResult2 }));
            playoffResults.Add(PlayoffRoundType.Finals, new List <Game>(new Game[] { finalsResult }));
            playoffResults.Add(PlayoffRoundType.Bronze, new List <Game>(new Game[] { bronzeMedalResult }));
            this.PlayoffResults = new PlayoffResults(playoffResults);
        }
Пример #2
0
        private void DoPlayoffs()
        {
            List <Team> teams = GetTop4Teams();

            teams.ForEach(x => x.MadePlayoffs = true);

            var oneTwoGame    = Team.PlayGame(teams[0], teams[1], RoundType.Playoff, true);
            var threeFourGame = Team.PlayGame(teams[2], teams[3], RoundType.Playoff, true);

            var semiFinal = Team.PlayGame(oneTwoGame.LosingTeam, threeFourGame.WinningTeam, RoundType.Playoff, true);

            var finalsResult = Team.PlayGame(oneTwoGame.WinningTeam, semiFinal.WinningTeam, RoundType.Playoff, true);

            finalsResult.WinningTeam.FinalRanking = 1;
            finalsResult.LosingTeam.FinalRanking  = 2;
            semiFinal.LosingTeam.FinalRanking     = 3;
            threeFourGame.LosingTeam.FinalRanking = 4;

            var playoffResults = new System.Collections.Generic.Dictionary <PlayoffRoundType, List <Game> >();

            playoffResults.Add(PlayoffRoundType.ThreeFourGame, new List <Game>(new Game[] { threeFourGame }));
            playoffResults.Add(PlayoffRoundType.OneTwoGame, new List <Game>(new Game[] { oneTwoGame }));
            playoffResults.Add(PlayoffRoundType.Semis, new List <Game>(new Game[] { semiFinal }));
            playoffResults.Add(PlayoffRoundType.Finals, new List <Game>(new Game[] { finalsResult }));
            this.PlayoffResults = new PlayoffResults(playoffResults);
        }
 private void DoRoundRobin()
 {
     for (var i = 0; i < Teams.Count; i++)
     {
         for (var j = i + 1; j < Teams.Count; j++)
         {
             Team.PlayGame(Teams[j], Teams[i], RoundType.Qualifying);
         }
     }
     SetFinalRankingsForNonPlayoffTeams();
 }
Пример #4
0
 private void DoQualifyingRound()
 {
     foreach (var division in Divisions)
     {
         var teams = division.Value;
         for (var i = 0; i < teams.Count; i++)
         {
             for (var j = i + 1; j < teams.Count; j++)
             {
                 Team.PlayGame(teams[j], teams[i], RoundType.Qualifying);
             }
         }
     }
     SetFinalRankingsForNonQualifyingTeams();
 }
Пример #5
0
        private void DoChampionshipRound()
        {
            var championshipTeams = GetChampionshipTeams();

            championshipTeams.ForEach(x => x.MadeChampionshipRound = true);
            for (var i = 0; i < championshipTeams.Count; i++)
            {
                for (var j = i + 1; j < championshipTeams.Count; j++)
                {
                    if (championshipTeams[j].DivisionNumber != championshipTeams[i].DivisionNumber)
                    {
                        Team.PlayGame(championshipTeams[j], championshipTeams[i], RoundType.Championship);
                    }
                }
            }
            SetFinalRankingsForNonPlayoffTeams(championshipTeams);
        }