Class EnumAction<T extends Enum<T>>

java.lang.Object
io.github.projectunified.minigamecore.editor.extra.action.EnumAction<T>
Type Parameters:
T - the type of the enum
All Implemented Interfaces:
EditorAction

public abstract class EnumAction<T extends Enum<T>> extends Object implements EditorAction
The EditorAction for enum value
  • Constructor Details

    • EnumAction

      public EnumAction(Class<T> enumClass)
      Create a new action
      Parameters:
      enumClass - the enum class
  • Method Details

    • execute

      public abstract boolean execute(EditorActor actor, T value, String[] args)
      Execute the action
      Parameters:
      actor - the actor
      value - the value
      args - the arguments
      Returns:
      true if the action is executed successfully
    • usage

      public String usage()
      Description copied from interface: EditorAction
      Get the usage of the action
      Specified by:
      usage in interface EditorAction
      Returns:
      the usage
    • complete

      public List<String> complete(EditorActor actor, String[] args)
      Description copied from interface: EditorAction
      Get the completion suggestions, given the arguments
      Specified by:
      complete in interface EditorAction
      Parameters:
      actor - the action
      args - the argument
      Returns:
      the suggestions
    • execute

      public boolean execute(EditorActor actor, String[] args)
      Description copied from interface: EditorAction
      Execute the action
      Specified by:
      execute in interface EditorAction
      Parameters:
      actor - the actor
      args - the arguments
      Returns:
      true if the action is executed successfully