コード例 #1
0
        /// <summary>
        ///     Retrieves the score for the player based on the current game state.
        /// </summary>
        /// <returns>The current score.</returns>
        public Score GetCurrentScore()
        {
            int totalPopularity         = groupService.GetTotalPopularity();
            int monthsInOffice          = governmentService.GetMonth();
            int pointsForMonthsInOffice = monthsInOffice * 3;
            int moneyGrabbed            = accountService.GetSwissBankAccountBalance();
            int pointsForMoneyGrabbing  = moneyGrabbed / 10;
            int highestScore            = governmentService.GetLastScore();
            int pointsForStayingAlive   = governmentService.IsPlayerAlive() ? 10 : 0;
            int totalScore = totalPopularity + pointsForMonthsInOffice + pointsForMoneyGrabbing + pointsForStayingAlive;

            Score score = new Score()
            {
                TotalPopularity         = totalPopularity,
                MonthsInOffice          = monthsInOffice,
                PointsForMonthsInOffice = pointsForMonthsInOffice,
                MoneyGrabbed            = moneyGrabbed,
                PointsForMoneyGrabbing  = pointsForMoneyGrabbing,
                HighestScore            = highestScore,
                PointsForStayingAlive   = pointsForStayingAlive,
                TotalScore = totalScore
            };

            return(score);
        }