public enum CommandType extends java.lang.Enum<CommandType>
Enum Constant and Description |
---|
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.
|
Modifier and Type | Method and Description |
---|---|
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.
|
public static final CommandType APPLY
public static final CommandType DROP
public static final CommandType EXAMINE
public static final CommandType LOCK
public static final CommandType LOCK_TOGGLE
public static final CommandType MARK
public static final CommandType UNLOCK
public static boolean canExecute(@Nullable GUIItemItem guiItem)
guiItem
- the item to check forprotected abstract void doExecute(@NotNull CfItem item, @NotNull CrossfireServerConnection crossfireServerConnection, int floor, @NotNull CommandQueue commandQueue)
item
- the item to execute oncrossfireServerConnection
- the server connection to usefloor
- the current floor indexcommandQueue
- the command queue to usepublic void execute(@Nullable GUIItemItem guiItem, @NotNull CrossfireServerConnection crossfireServerConnection, int floor, @NotNull CommandQueue commandQueue)
guiItem
- the item to execute oncrossfireServerConnection
- the server connection to usefloor
- the current floor indexcommandQueue
- the command queue to usepublic static CommandType valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullpublic static CommandType[] values()
for (CommandType c : CommandType.values()) System.out.println(c);