Interface ActionAPI
- All Known Subinterfaces:
GameAPI
public interface ActionAPI
Game action queuing and execution control.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionbooleanChecks whether action queuing is currently blocked.voidClears all pending actions from the queue.getActionHistory(int maxResults, int actionIdFilter) Returns a history of recently executed actions.intReturns the number of actions currently pending in the queue.longReturns the game-cycle timestamp of the last executed action.voidqueueAction(GameAction action) Queues a single game action for execution on the next game tick.intqueueActions(List<GameAction> actions) Queues multiple game actions for execution.voidsetActionsBlocked(boolean blocked) Enables or disables action blocking.
-
Method Details
-
queueAction
Queues a single game action for execution on the next game tick.- Parameters:
action- the action to queue
-
queueActions
Queues multiple game actions for execution.- Parameters:
actions- the actions to queue- Returns:
- the number of actions successfully queued
-
getActionQueueSize
int getActionQueueSize()Returns the number of actions currently pending in the queue.- Returns:
- the queue size
-
clearActionQueue
void clearActionQueue()Clears all pending actions from the queue. -
getActionHistory
Returns a history of recently executed actions.- Parameters:
maxResults- maximum number of entries to returnactionIdFilter- filter by action ID, or-1for all- Returns:
- a list of historical action entries
-
getLastActionTime
long getLastActionTime()Returns the game-cycle timestamp of the last executed action.- Returns:
- the timestamp in milliseconds
-
areActionsBlocked
boolean areActionsBlocked()Checks whether action queuing is currently blocked.- Returns:
trueif actions are blocked
-
setActionsBlocked
void setActionsBlocked(boolean blocked) Enables or disables action blocking.- Parameters:
blocked-trueto block actions,falseto unblock
-