Class CommandHandler
java.lang.Object
|
+--CommandHandler
- public class CommandHandler
- extends java.lang.Object
The CommandHandler parses command strings (such as "take bucket"),
calls the appropriate methods of Player, and returns the result.
Since there is nothing special to do in the constructor, we just
let Java create a default constructor for us.
- Author:
- David Matuszek
|
Method Summary |
static java.lang.String |
handleCommand(Player player,
java.lang.String commandString)
Given a Player and a command, this routine parses the command
and calls the appropriate method of the Player; the result of
the call is returned as a string. |
static java.lang.String |
help()
Returns a list of available commands. |
| Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait |
CommandHandler
public CommandHandler()
handleCommand
public static java.lang.String handleCommand(Player player,
java.lang.String commandString)
- Given a Player and a command, this routine parses the command
and calls the appropriate method of the Player; the result of
the call is returned as a string.
- Parameters:
player - the Player that the command is directed tocommand - the input command to be parsed- Returns:
- the result of executing the command
help
public static java.lang.String help()
- Returns a list of available commands.