예제 #1
0
파일: Gaston.cs 프로젝트: Mashakal/Gaston
        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();
        }
예제 #2
0
 public UserInput GetUserInput()
 {
     var input = new UserInput();
     input.RawInput = ReadInput();
     Console.WriteLine();
     return input;
 }