1package com.runehive.game.action;
3import com.runehive.game.action.policy.WalkablePolicy;
4import com.runehive.game.world.World;
5import com.runehive.game.world.entity.mob.Mob;
7import java.util.ArrayDeque;
8import java.util.Objects;
96 this.currentAction =
null;
102 actionEvent.cancel();
116 if (Objects.equals(actionEvent.getName(), name)) {
117 actionEvent.cancel();
The class which manages Actions executed by mobs.
void cancel()
Cancels the current Action for the underlying Mob.
void clearNonWalkableActions()
Purges actions in the queue with a WalkablePolicy of NON_WALKABLE.
public< A extends Action<?> > void queue(A action)
Queues the specified action.
public< A extends Action<?> > void execute(A action, boolean override)
Adds an Action to the queue.
void cancelQueuedActions()
Cancels all the queued actions by stopping them and removing all elements from the queue.
void sequence()
Sequences the pending actions, and as soon as the current action has stopped, it executes the head of...
Action<?> getCurrentAction()
Gets the current action.
void reset()
Resets all the actions for the underlying Mob.
public< A extends Action<?> > void execute(A action)
Action<?> currentAction
The current action.
void cancel(String name)
Purges actions in the queue with a WalkablePolicy of NON_WALKABLE.
final Queue< Action<?> > queuedActions
A queue of Action object.
synchronized final void cancel()
Cancels all subsequent executions.
Represents the game world.
static void schedule(Task task)
Submits a new event.
A queue policy determines whether the action can occur while walking.
WALKABLE
This indicates actions may occur while walking.
NON_WALKABLE
This indicates actions cannot occur while walking.