Пример #1
0
        /// <summary>
        ///     Asks the player if the police report should be displayed and if the user accepts, displays it.
        /// </summary>
        private void ProcessPoliceReport()
        {
            PoliceReportRequest policeReportRequest = engine.RequestPoliceReport();
            DialogResult        dialogResult        = userInterface.DisplayPoliceReportRequestDialog(policeReportRequest);

            if (dialogResult == DialogResult.Yes)
            {
                engine.PayFromTreasury(1);
                DisplayPoliceReportScreen();
            }
        }
Пример #2
0
        /// <summary>
        ///     Retrieves a request for a detailed account or statement from police on the state of the groups and government.
        /// </summary>
        /// <returns>A police report request with information on the popularity and strength requirements.</returns>
        public PoliceReportRequest RequestPoliceReport()
        {
            PoliceReportRequest policeReportRequest = new PoliceReportRequest
            {
                HasEnoughBalance = accountService.GetTreasuryBalance() > 0,
                IsPlayerPopularWithSecretPolice = IsPlayerPopularWithSecretPolice(),
                HasPoliceEnoughStrength         = HasPoliceEnoughStrength(),
                PolicePopularity = groupService.GetPopularityByGroupType(GroupType.SecretPolice),
                PoliceStrength   = groupService.GetStrengthByGroupType(GroupType.SecretPolice)
            };

            return(policeReportRequest);
        }
Пример #3
0
        public DialogResult Show(PoliceReportRequest policeReportRequest)
        {
            ConsoleEx.Clear(ConsoleColor.Black, ConsoleColor.White);
            ConsoleEx.WriteEmptyLineAt(1, ConsoleColor.Yellow);
            ConsoleEx.WriteEmptyLineAt(2, ConsoleColor.Yellow);
            ConsoleEx.WriteAt(1, 7, "     SECRET POLICE REPORT ?     ");

            DialogResult dialogResult;

            if (policeReportRequest.HasEnoughBalance && policeReportRequest.IsPlayerPopularWithSecretPolice && policeReportRequest.HasPoliceEnoughStrength)
            {
                ConsoleEx.WriteAt(1, 13, "         ( costs $1000 )        ");
                dialogResult = pressAnyKeyWithYesControl.Show();
            }
            else
            {
                ConsoleEx.WriteAt(1, 10, "          NOT AVAILABLE         ");

                int screenRow = 12;

                if (!policeReportRequest.IsPlayerPopularWithSecretPolice)
                {
                    ConsoleEx.WriteAt(1, screenRow++, $"  Your POPULARITY with us is {policeReportRequest.PolicePopularity}  ");
                }

                if (!policeReportRequest.HasPoliceEnoughStrength)
                {
                    ConsoleEx.WriteAt(1, screenRow++, $"      POLICE strength is {policeReportRequest.PoliceStrength}      ");
                }

                if (!policeReportRequest.HasEnoughBalance)
                {
                    ConsoleEx.WriteAt(1, screenRow++, "    You can't AFFORD a REPORT   ");
                }

                dialogResult = DialogResult.No;
                pressAnyKeyControl.Show();
            }

            return(dialogResult);
        }
Пример #4
0
 public DialogResult DisplayPoliceReportRequestDialog(PoliceReportRequest policeReportRequest) => policeReportRequestScreen.Show(policeReportRequest);