Exemple #1
0
        public static void GetMatchResult(LeagueFixture fixture)
        {
            var matchScore = GetMatchScore(fixture);

            fixture.SetFixtureResult(matchScore.HomeGoals, matchScore.AwayGoals);

            SetFixtureResultRelatedStatistics(fixture);

            if (matchScore.HomeGoals > matchScore.AwayGoals)
            {
                fixture.HomeTeam.UpdateBoardHappiness(5);
                fixture.HomeTeam.UpdateMorale(1);
                fixture.AwayTeam.UpdateBoardHappiness(-3);
                fixture.AwayTeam.UpdateMorale(-1);
                return;
            }
            else if (matchScore.AwayGoals > matchScore.HomeGoals)
            {
                fixture.HomeTeam.UpdateBoardHappiness(-8);
                fixture.HomeTeam.UpdateMorale(-1);
                fixture.AwayTeam.UpdateBoardHappiness(6);
                fixture.AwayTeam.UpdateMorale(1);
                return;
            }

            fixture.HomeTeam.UpdateMorale(-3);
            fixture.AwayTeam.UpdateMorale(1);
        }