Ejemplo n.º 1
0
        /// <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);
            }
        }
Ejemplo n.º 2
0
 private static void Main(string[] args)
 {
     HangmanStartPoint.Start(new ConsoleUI(), new CommandFactory());
 }