Beispiel #1
0
        /// <summary>
        /// Starts the tournament with generate the fixture
        /// </summary>
        /// <param name="id"></param>
        /// <param name="teams"></param>
        public void StartById(int id, List <TeamEntity> teams)
        {
            FixtureManager fixtureManager = new FixtureManager(teams, id, _tournamentBracketRoundService, _playedGamesService);

            fixtureManager.GenerateFixture();
            _tournamentDAL.StartById(id);
        }
Beispiel #2
0
        public void AddWinnerToNextGame(PlayedGamesEntity playedGame, TeamEntity winnerTeam)
        {
            FixtureManager fm           = new FixtureManager(this);
            var            roundMatchId = playedGame.RoundMatchId;
            var            nextTable    = fm.FindTheNextTableForGame(playedGame);

            if (nextTable != null)
            {
                if (roundMatchId % 2 == 0)
                {
                    nextTable.HomeTeamId = winnerTeam.Id;
                }
                else
                {
                    nextTable.AwayTeamId = winnerTeam.Id;
                }

                this.Update(nextTable);
            }
        }