Files
basic-computer-games/12_Bombs_Away/csharp/BombsAwayConsole/Program.cs
Martin Thoma e64fb6795c MAINT: Apply pre-commit
Remove byte-order-marker pre-commit check as there would be
many adjustments necessary
2022-03-05 09:29:23 +01:00

26 lines
539 B
C#

using BombsAwayConsole;
using BombsAwayGame;
/// Create and play <see cref="Game"/>s using a <see cref="ConsoleUserInterface"/>.
PlayGameWhileUserWantsTo(new ConsoleUserInterface());
void PlayGameWhileUserWantsTo(ConsoleUserInterface ui)
{
do
{
new Game(ui).Play();
}
while (UserWantsToPlayAgain(ui));
}
bool UserWantsToPlayAgain(IUserInterface ui)
{
bool result = ui.ChooseYesOrNo("ANOTHER MISSION (Y OR N)?");
if (!result)
{
Console.WriteLine("CHICKEN !!!");
}
return result;
}