Ejemplo n.º 1
0
        public void Play()
        {
            // Initialize the game objects, Init takes a LocationNode.Name literal to indicate the player's current LocationNode
            gameData = Init("Stasis Pod");

            // Create the UserInput object for handling and processing user input
            var userInput = new UserInput();

            // Setup the Console Handler for getting input and displaying output
            var consoleHandler = new ConsoleHandler();
            consoleHandler.Clear();

            do
            {
                // Display the OpeningParagraphs text to the console
                consoleHandler.OutputLocationText(gameData); 
                // Listen
                consoleHandler.DrawPrompt();
                userInput = consoleHandler.GetUserInput();
                // Think
                userInput.ProcessText(gameData);
                // Speak
                consoleHandler.WriteOutput(userInput.Result);
            }
            while (userInput.Result.ToLower() != "quit");

            // clear the console before quitting
            consoleHandler.Clear();
        }
Ejemplo n.º 2
0
 public UserInput GetUserInput()
 {
     var input = new UserInput();
     input.RawInput = ReadInput();
     Console.WriteLine();
     return input;
 }