/// <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); }
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); } }