Ejemplo n.º 1
0
        private void UpdateNationalCupWinner(PostMatchData postMatchData)
        {
            var cupFinal = postMatchData.MatchesNationalCup.Single();

            postMatchData.SeasonStatistics.CupWinner   = cupFinal.GetWinner();
            postMatchData.SeasonStatistics.CupRunnerUp = cupFinal.GetLoser();
        }
Ejemplo n.º 2
0
        private void UpdateNationalSuperCupWinner(PostMatchData postMatchData)
        {
            var match  = postMatchData.MatchesNationalSuperCup.Single();
            var winner = match.GetWinner();

            postMatchData.SeasonStatistics.NationalSuperCupWinner = winner;
        }
Ejemplo n.º 3
0
        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);
        }
Ejemplo n.º 4
0
 private void UpdateManagerPlaysMatch(PostMatchData postMatchData)
 {
     foreach (var matchDate in postMatchData.NewManagerMatchDates)
     {
         _gameDateTimeMutationManager.UpdateManagerPlaysMatch(matchDate);
     }
 }
Ejemplo n.º 5
0
        public void Handle(PostMatchData postMatchData)
        {
            if (!postMatchData.MatchesNationalCup.Any())
            {
                return;
            }

            postMatchData.CupMatchesNextRound = _nationalCupManager.DrawNextRound(postMatchData.RoundNationalCup, postMatchData.MatchesNationalCup, postMatchData.Season);
        }
Ejemplo n.º 6
0
        public void Handle(PostMatchData postMatchData)
        {
            if (postMatchData.NewManagerMatchDates.Any())
            {
                UpdateManagerPlaysMatch(postMatchData);
            }

            UpdateMatchStatus(postMatchData);
        }
Ejemplo n.º 7
0
 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);
        }
Ejemplo n.º 9
0
        public void Handle(PostMatchData postMatchData)
        {
            if (postMatchData.League1Finished)
            {
                UpdateNationalChampion(postMatchData);
            }

            if (postMatchData.NationalCupFinalHasBeenPlayed)
            {
                UpdateNationalCupWinner(postMatchData);
            }

            if (postMatchData.MatchesNationalSuperCup.Any())
            {
                UpdateNationalSuperCupWinner(postMatchData);
            }
        }
Ejemplo n.º 10
0
        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);
            }
        }
Ejemplo n.º 11
0
 public void Handle(PostMatchData postMatchData)
 {
     UpdateLeagueTablePositions(postMatchData);
 }
Ejemplo n.º 12
0
 private void UpdateNationalChampion(PostMatchData postMatchData)
 {
     postMatchData.SeasonStatistics.NationalChampion         = postMatchData.LeagueTableLeague1.LeagueTablePositions[0].Team;
     postMatchData.SeasonStatistics.NationalChampionRunnerUp = postMatchData.LeagueTableLeague1.LeagueTablePositions[1].Team;
 }
Ejemplo n.º 13
0
        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);
        }
Ejemplo n.º 14
0
 private void UpdateMatchStatus(PostMatchData postMatchData)
 {
     // Update match status in the calendar.
     _gameDateTimeMutationManager.UpdateMatchStatus(postMatchData.MatchDateTime);
 }