/// <summary> /// Asks the player to make a decision on a request made by one of the groups. The player /// can either accept or refuse the request. /// </summary> /// <param name="audience">The audience that the player will be asked to make a decision on.</param> private void AskForAudienceDecision(Core.Audience audience) { DialogResult dialogResult = userInterface.DisplayAudienceDecisionDialog(audience); if (dialogResult == DialogResult.Yes) { engine.AcceptAudienceRequest(audience); } else { engine.RefuseAudienceRequest(audience); } }
/// <summary> /// Handles the generation and processing of an audience request from one of the groups. /// </summary> private void HandleAudienceRequest() { Core.Audience audience = engine.SelectRandomUnusedAudienceRequest(); userInterface.DisplayAudienceScreen(audience); if (DoesPlayerAcceptAdvice()) { userInterface.DisplayAdviceScreen(audience); } AskForAudienceDecision(audience); DisplayAccountDetails(); }
/// <summary> /// Displays the screen. /// </summary> /// <param name="audience">The audience information to display on the screen.</param> public void Show(Core.Audience audience) { ConsoleEx.Clear(); ConsoleEx.WriteEmptyLineAt(1, ConsoleColor.Green); ConsoleEx.WriteEmptyLineAt(2, ConsoleColor.Green); ConsoleEx.WriteEmptyLineAt(3, ConsoleColor.Green); ConsoleEx.WriteEmptyLineAt(4, ConsoleColor.Green); ConsoleEx.WriteAt(11, 4, "AN AUDIENCE", ConsoleColor.White, ConsoleColor.Black); ConsoleEx.WriteEmptyLineAt(5, ConsoleColor.Green); for (int row = 6; row < 22; row++) { ConsoleEx.WriteEmptyLineAt(row, ConsoleColor.DarkYellow); } ConsoleEx.WriteAt(1, 11, $" A request from {audience.Requester}", ConsoleColor.DarkYellow, ConsoleColor.Black); ConsoleEx.WriteAt(1, 15, " Will YOUR EXCELLENCY agree to ", ConsoleColor.DarkYellow, ConsoleColor.Black); ConsoleEx.WriteAt(1, 17, $"{audience.Text}", ConsoleColor.Yellow, ConsoleColor.Black); pressAnyKeyControl.Show(); }
/// <summary> /// Displays the dialog. /// </summary> /// <param name="audience">The audience information to display on the screen.</param> /// <returns>The option selected after the dialog has been presented.</returns> public DialogResult Show(Core.Audience audience) { ConsoleEx.Clear(ConsoleColor.DarkYellow); ConsoleEx.WriteAt(11, 2, " DECISION ", ConsoleColor.Black, ConsoleColor.White); ConsoleEx.WriteAt(5, 4, $"The {audience.Requester} ask you to", ConsoleColor.Magenta, ConsoleColor.Gray); ConsoleEx.WriteAt(1, 6, $"{audience.Text}", ConsoleColor.Yellow, ConsoleColor.Black); ConsoleEx.WriteEmptyLineAt(8, ConsoleColor.Blue); Console.BackgroundColor = ConsoleColor.DarkYellow; if (audience.NoMoneyInvolved) { ConsoleEx.WriteAt(1, 11, " NO MONEY INVOLVED ", ConsoleColor.Black); } else { ConsoleEx.WriteAt(2, 10, "This decision would", ConsoleColor.Black); if (audience.Cost != 0) { string addOrTake = (audience.Cost > 0) ? "ADD to" : "TAKE from"; ConsoleEx.WriteAt(2, 12, $"{addOrTake} the TREASURY ${Math.Abs(audience.Cost)},000", ConsoleColor.Black); } if (audience.Cost != 0 && audience.MonthlyCost != 0) { ConsoleEx.WriteAt(2, 14, "and", ConsoleColor.Black); } if (audience.MonthlyCost != 0) { string raiseOrLower = (audience.MonthlyCost < 0) ? "RAISE" : "LOWER"; ConsoleEx.WriteAt(2, 16, $"{raiseOrLower} MONTHLY COSTS by ${Math.Abs(audience.MonthlyCost)},000", ConsoleColor.Black); } } return(pressAnyKeyWithYesControl.Show()); }
public void DisplayAdviceScreen(Core.Audience audience) => adviceScreen.Show(audience);
public DialogResult DisplayAudienceDecisionDialog(Core.Audience audience) => audienceDecisionDialog.Show(audience);