Enum Class CommandType
- All Implemented Interfaces:
Serializable,Comparable<CommandType>,Constable
The executable commands.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionstatic booleancanExecute(@Nullable GUIItemItem guiItem) Returns whether the action can be executed.protected abstract voiddoExecute(@NotNull CfItem item, @NotNull CrossfireServerConnection crossfireServerConnection, int floor, @NotNull CommandQueue commandQueue) Executes the action.voidexecute(@Nullable GUIItemItem guiItem, @NotNull CrossfireServerConnection crossfireServerConnection, int floor, @NotNull CommandQueue commandQueue) Executes the action.static CommandTypeReturns the enum constant of this class with the specified name.static CommandType[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
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 Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
canExecute
Returns whether the action can be executed.- Parameters:
guiItem- the item to check for- Returns:
- whether the action can be executed
-
execute
public void execute(@Nullable @Nullable GUIItemItem guiItem, @NotNull @NotNull CrossfireServerConnection crossfireServerConnection, int floor, @NotNull @NotNull CommandQueue commandQueue) Executes the action.- Parameters:
guiItem- the item to execute oncrossfireServerConnection- the server connection to usefloor- the current floor indexcommandQueue- the command queue to use
-
doExecute
protected abstract void doExecute(@NotNull @NotNull CfItem item, @NotNull @NotNull CrossfireServerConnection crossfireServerConnection, int floor, @NotNull @NotNull CommandQueue commandQueue) Executes the action.- Parameters:
item- the item to execute oncrossfireServerConnection- the server connection to usefloor- the current floor indexcommandQueue- the command queue to use
-