private void UpdateNationalCupWinner(PostMatchData postMatchData) { var cupFinal = postMatchData.MatchesNationalCup.Single(); postMatchData.SeasonStatistics.CupWinner = cupFinal.GetWinner(); postMatchData.SeasonStatistics.CupRunnerUp = cupFinal.GetLoser(); }
private void UpdateNationalSuperCupWinner(PostMatchData postMatchData) { var match = postMatchData.MatchesNationalSuperCup.Single(); var winner = match.GetWinner(); postMatchData.SeasonStatistics.NationalSuperCupWinner = winner; }
public void Handle(PostMatchData postMatchData) { var teamStatisticsManager = new TeamStatisticsManager(postMatchData.TeamStatistics); // Update the season team statistics for this season. teamStatisticsManager.Update(postMatchData.LeagueTables.Values, postMatchData.Leagues); }
private void UpdateManagerPlaysMatch(PostMatchData postMatchData) { foreach (var matchDate in postMatchData.NewManagerMatchDates) { _gameDateTimeMutationManager.UpdateManagerPlaysMatch(matchDate); } }
public void Handle(PostMatchData postMatchData) { if (!postMatchData.MatchesNationalCup.Any()) { return; } postMatchData.CupMatchesNextRound = _nationalCupManager.DrawNextRound(postMatchData.RoundNationalCup, postMatchData.MatchesNationalCup, postMatchData.Season); }
public void Handle(PostMatchData postMatchData) { if (postMatchData.NewManagerMatchDates.Any()) { UpdateManagerPlaysMatch(postMatchData); } UpdateMatchStatus(postMatchData); }
private void UpdateLeagueTablePositions(PostMatchData postMatchData) { foreach (var leagueTable in postMatchData.LeagueTables.Values) { foreach (var position in leagueTable.LeagueTablePositions) { postMatchData.Teams[position.TeamId].CurrentLeaguePosition = position.Position; } } }
public void Handle(PostMatchData postMatchData) { if (postMatchData.NationalCupFinalHasBeenPlayed || !postMatchData.CupMatchesNextRound.Any()) { return; } // During the next cup round there also might be a friendly round. If so, generate friendly matches. var teamsInNextCupRound = postMatchData.CupMatchesNextRound.Select(m => m.HomeTeam).ToList(); teamsInNextCupRound.AddRange(postMatchData.CupMatchesNextRound.Select(m => m.AwayTeam)); postMatchData.DuringSeasonFriendlies = _duringSeasonFriendlyManager.CreateDuringSeasonFriendlies(postMatchData.RoundNationalCup, teamsInNextCupRound); }
public void Handle(PostMatchData postMatchData) { if (postMatchData.League1Finished) { UpdateNationalChampion(postMatchData); } if (postMatchData.NationalCupFinalHasBeenPlayed) { UpdateNationalCupWinner(postMatchData); } if (postMatchData.MatchesNationalSuperCup.Any()) { UpdateNationalSuperCupWinner(postMatchData); } }
public void Handle(PostMatchData postMatchData) { if (postMatchData.MatchesLeague1.Any()) { _leagueTableManager.UpdateLeagueTable(postMatchData.LeagueTableLeague1, postMatchData.MatchesLeague1); } if (postMatchData.MatchesLeague2.Any()) { _leagueTableManager.UpdateLeagueTable(postMatchData.LeagueTableLeague2, postMatchData.MatchesLeague2); } if (postMatchData.MatchesLeague3.Any()) { _leagueTableManager.UpdateLeagueTable(postMatchData.LeagueTableLeague3, postMatchData.MatchesLeague3); } if (postMatchData.MatchesLeague4.Any()) { _leagueTableManager.UpdateLeagueTable(postMatchData.LeagueTableLeague4, postMatchData.MatchesLeague4); } }
public void Handle(PostMatchData postMatchData) { UpdateLeagueTablePositions(postMatchData); }
private void UpdateNationalChampion(PostMatchData postMatchData) { postMatchData.SeasonStatistics.NationalChampion = postMatchData.LeagueTableLeague1.LeagueTablePositions[0].Team; postMatchData.SeasonStatistics.NationalChampionRunnerUp = postMatchData.LeagueTableLeague1.LeagueTablePositions[1].Team; }
public void Handle(PostMatchData postMatchData) { var seasonTeamStatisticsManager = new SeasonTeamStatisticsManager(postMatchData.SeasonTeamStatistics, postMatchData.Season.Id); seasonTeamStatisticsManager.Update(postMatchData.Season.Id, postMatchData.Matches.Values.SelectMany(x => x), postMatchData.LeagueTables.Values); }
private void UpdateMatchStatus(PostMatchData postMatchData) { // Update match status in the calendar. _gameDateTimeMutationManager.UpdateMatchStatus(postMatchData.MatchDateTime); }