com.realtime.crossfire.jxclient.commands
Class Commands

java.lang.Object
  extended by com.realtime.crossfire.jxclient.commands.Commands

public class Commands
extends java.lang.Object

Parses and executes client-side commands.


Field Summary
private  CommandQueue commandQueue
          The command queue for sending commands.
private  java.util.Map<java.lang.String,Command> commands
          Maps command name to Command instance.
 
Constructor Summary
Commands(JXCWindowRenderer windowRenderer, CommandQueue commandQueue, CrossfireServerConnection crossfireServerConnection, ScriptManager scriptManager, OptionManager optionManager, CommandCallback commandCallback, Macros macros)
          Creates a new instance.
 
Method Summary
private  boolean execute(java.lang.String command, java.lang.String commandList)
          Executes a client-side command.
 void executeCommand(java.lang.CharSequence commands)
          Executes a command or a list of commands.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

commandQueue

@NotNull
private final CommandQueue commandQueue
The command queue for sending commands.


commands

@NotNull
private final java.util.Map<java.lang.String,Command> commands
Maps command name to Command instance.

Constructor Detail

Commands

public Commands(@NotNull
                JXCWindowRenderer windowRenderer,
                @NotNull
                CommandQueue commandQueue,
                @NotNull
                CrossfireServerConnection crossfireServerConnection,
                @NotNull
                ScriptManager scriptManager,
                @NotNull
                OptionManager optionManager,
                @NotNull
                CommandCallback commandCallback,
                @NotNull
                Macros macros)
Creates a new instance.

Parameters:
windowRenderer - the renderer to use
commandQueue - the command queue for sending commands
crossfireServerConnection - the connection instance
scriptManager - the script manager instance
optionManager - the option manager instance
commandCallback - the command callback to use
macros - the macros instance to use
Method Detail

execute

private boolean execute(@NotNull
                        java.lang.String command,
                        @NotNull
                        java.lang.String commandList)
Executes a client-side command.

Parameters:
command - the command
commandList - the command and all remaining commands of the command list
Returns:
true if all remaining commands have been consumed

executeCommand

public void executeCommand(@NotNull
                           java.lang.CharSequence commands)
Executes a command or a list of commands. The commands may be a client- or a server-sided command.

Parameters:
commands - the commands to execute