com.realtime.crossfire.jxclient.gui.commands
Enum CommandType

java.lang.Object
  extended by java.lang.Enum<CommandType>
      extended by com.realtime.crossfire.jxclient.gui.commands.CommandType
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<CommandType>

public enum CommandType
extends java.lang.Enum<CommandType>

The executable commands.


Enum Constant Summary
APPLY
          Apply an item.
DROP
          Drop an item (to the ground of into an opened container).
EXAMINE
          Examine an item.
LOCK
          Lock an item.
LOCK_TOGGLE
          Toggle the lock of an item.
MARK
          Mark an item.
UNLOCK
          Unlock an item.
 
Method Summary
static boolean canExecute(GUIItemItem guiItem)
          Returns whether the action can be executed.
protected abstract  void doExecute(CfItem item, CrossfireServerConnection crossfireServerConnection, int floor, CommandQueue commandQueue)
          Executes the action.
 void execute(GUIItemItem guiItem, CrossfireServerConnection crossfireServerConnection, int floor, CommandQueue commandQueue)
          Executes the action.
static CommandType valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static CommandType[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

APPLY

public static final CommandType APPLY
Apply an item.


DROP

public static final CommandType DROP
Drop an item (to the ground of into an opened container).


EXAMINE

public static final CommandType EXAMINE
Examine an item.


LOCK

public static final CommandType LOCK
Lock an item.


LOCK_TOGGLE

public static final CommandType LOCK_TOGGLE
Toggle the lock of an item.


MARK

public static final CommandType MARK
Mark an item.


UNLOCK

public static final CommandType UNLOCK
Unlock an item.

Method Detail

canExecute

public static boolean canExecute(@Nullable
                                 GUIItemItem guiItem)
Returns whether the action can be executed.

Parameters:
guiItem - the item to check for
Returns:
whether the action can be executed

doExecute

protected abstract void doExecute(@NotNull
                                  CfItem item,
                                  @NotNull
                                  CrossfireServerConnection crossfireServerConnection,
                                  int floor,
                                  @NotNull
                                  CommandQueue commandQueue)
Executes the action.

Parameters:
item - the item to execute on
crossfireServerConnection - the server connection to use
floor - the current floor index
commandQueue - the command queue to use

execute

public void execute(@Nullable
                    GUIItemItem guiItem,
                    @NotNull
                    CrossfireServerConnection crossfireServerConnection,
                    int floor,
                    @NotNull
                    CommandQueue commandQueue)
Executes the action.

Parameters:
guiItem - the item to execute on
crossfireServerConnection - the server connection to use
floor - the current floor index
commandQueue - the command queue to use

valueOf

public static CommandType valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null

values

public static CommandType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (CommandType c : CommandType.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared