Package com.bdtripp.hauntedhouse.engine
Class Parser
java.lang.Object
com.bdtripp.hauntedhouse.engine.Parser
Parses raw player input into structured commands.
The Parser tokenizes input from either the CLI or web client, extracts up to three command words,
and produces a Command object for processing.
- Author:
- Michael Kölling, David J. Barnes, and Brian Tripp
-
Constructor Summary
ConstructorsConstructorDescriptionParser(InputStream inputStream) For the CLI applicationFor the Web application -
Method Summary
Modifier and TypeMethodDescriptionReturns a tokenized version of the command that was entered by the player
-
Constructor Details
-
Parser
For the Web application- Parameters:
string- the input to tokenize
-
Parser
For the CLI application- Parameters:
inputStream- the input stream to tokenize
-
-
Method Details
-
getCommand
Returns a tokenized version of the command that was entered by the player- Returns:
- the command
-