public void CommandInterpreterDecodeHelpInput()
		{
			Game game = new Game(new InitialState());

			game.Word = new Word();

			CommandInterpreter.AssignGameDelegate(() => game);

			var decoder = new CommandInterpreter();

			decoder.Decode("help");
		}
Example #2
0
        public override void PerformAction(Game game)
        {
            if (game.Word.MaskedWord.Contains('_'))
            {
                Console.WriteLine("The secret word is " + game.Word.MaskedWord);

                Console.Write("Enter your guess: ");

                string command = Console.ReadLine();

                CommandInterpreter decoder = new CommandInterpreter();

                decoder.Decode(command);
            }
            else
            {
                GameEngine.EstimateScore(game.Word, game.NumberOfMistakes);
                game.NumberOfMistakes = 0;

                game.State = new InitialState();
            }
        }
Example #3
-20
        public override void PerformAction(Game game)
        {
            if (game.Word.MaskedWord.Contains('_'))
            {
                Console.WriteLine("The secret word is " + game.Word.MaskedWord);

                Console.Write("Enter your guess: ");

                string command = Console.ReadLine();

                CommandInterpreter decoder = new CommandInterpreter();

                decoder.Decode(command);
            }
            else
            {
                GameEngine.EstimateScore(game.Word, game.NumberOfMistakes);
                game.NumberOfMistakes = 0;

                game.State = new InitialState();
            }
        }