Package me.autobot.lib.systems.actions
Class Action
java.lang.Object
me.autobot.lib.systems.actions.Action
An action that can be called and performed by the robot.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidActivates the given action to be executed and run to completion.voidcancel()Cancels and effectively stops executing the action.voidexecute()Executes the action.getUUID()Returns the UUID of the action.booleanReturns whether the action has finished.voidinit()Called when the action is initialized.booleanReturns whether the action has been cancelled.static voidupdate()Updates all actions.
-
Constructor Details
-
Action
public Action()Creates a new Action.
-
-
Method Details
-
activate
Activates the given action to be executed and run to completion.- Parameters:
action- The action to activate.
-
update
public static void update()Updates all actions. -
init
public void init()Called when the action is initialized. -
execute
public void execute()Executes the action. -
cancel
public void cancel()Cancels and effectively stops executing the action. -
hasFinished
public boolean hasFinished()Returns whether the action has finished.- Returns:
- Whether the action has finished.
-
isCancelled
public boolean isCancelled()Returns whether the action has been cancelled.- Returns:
- Whether the action has been cancelled.
-
getUUID
Returns the UUID of the action.- Returns:
- The UUID of the action.
-