/// <summary> /// Start new game if player still want to play or redirect to menu. /// </summary> /// <param name="game">Instance of <see cref="HangmanGame"/> class.</param> public override void Play(HangmanGame game) { game.UI.Print("Title", "Title"); game.UI.Print(Messages.PlayAgainMessage, "Message"); char playAgainYesNo = game.UI.ReadKey(); if (playAgainYesNo == 'y') { game.State = new ChooseCategoryState(); game.State.Play(game); } else if (playAgainYesNo == 'n') { HangmanStartPoint.Main(); } else { game.UI.Print(Messages.WrongCommand, "Message"); this.Play(game); } }
private static void Main(string[] args) { HangmanStartPoint.Start(new ConsoleUI(), new CommandFactory()); }