|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object wyvern.kernel.player.ClientCommands
Handles special commands from the client. Each Player gets one of these, which can be accessed via the player's clientCommands() method. The client sends various commands to the server that start with "#". If you want to be notified when one of these commands is sent, you register with the ClientCommands to be notified for a particular set of client commands.
Nested Class Summary |
Nested classes inherited from class wyvern.common.net.RPCConstants |
RPCConstants.ImageAlign, RPCConstants.ImageFlags, RPCConstants.ImageFormat, RPCConstants.OutputView, RPCConstants.TextStyle |
Field Summary |
Method Summary | |
void |
addCommands(java.util.Map commands,
CommandList list)
Adds commands. |
CommandEvent |
createEvent(CommandEvent event)
Creates the event. |
boolean |
execute(CommandEvent event)
Executes the event containing a client directive. |
static ClientCommands |
getImpl()
|
boolean |
knowsCommand(java.lang.String command)
Returns true if we want to handle the specified command. |
boolean |
refresh(CommandEvent event)
Refreshes the player's screen - usually not necessary, but used (e.g.) when toggling terrain borders, or when a new image has arrived on the client. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
public static ClientCommands getImpl()
public final void addCommands(java.util.Map commands, CommandList list)
addCommands
in interface BuiltInCommand
commands
- the java.util.Map to register withlist
- the CommandList the Command is being added to.public boolean knowsCommand(java.lang.String command)
knowsCommand
in interface Command
command
- the entire command string, including arguments
public CommandEvent createEvent(CommandEvent event)
createEvent
in interface Command
event
- a "blank" CommandEvent containing only the
command text and the agent who's performing the command. This
initial event is created by the originator of the event (e.g.
the AI or player's command preprocessor).
public boolean execute(CommandEvent event)
execute
in interface Command
event
- the event containing the parsed directive
(verb + args)
public boolean refresh(CommandEvent event)
event
- the eventpublic java.lang.String toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |