RuneHive-Game
Loading...
Searching...
No Matches
com.runehive.game.action.ConsecutiveAction< T extends Mob > Class Template Referenceabstract
Inheritance diagram for com.runehive.game.action.ConsecutiveAction< T extends Mob >:
Collaboration diagram for com.runehive.game.action.ConsecutiveAction< T extends Mob >:

Public Member Functions

 ConsecutiveAction (T mob)
 Generates a new ConsecutiveAction object.
void execute ()
Public Member Functions inherited from com.runehive.game.action.Action< T >
 Action (T mob, int delay, boolean instant)
 Creates a new Action randomevent.
boolean cancellableInProgress ()
getMob ()
 Gets the player.
abstract String getName ()
 Gets the name of this action.
abstract WalkablePolicy getWalkablePolicy ()
 Gets the WalkablePolicy of this action.
boolean prioritized ()
 Determines if this action is prioritized.

Protected Member Functions

void add (Consumer< Action< T > > action)
 Adds an action to the actions list.
void addFirst (Consumer< Action< T > > action)
 Adds an action to the actions list.

Private Attributes

LinkedList< Consumer< Action< T > > > actions = new LinkedList<>()
 The list of actions.

Detailed Description

Definition at line 8 of file ConsecutiveAction.java.

Constructor & Destructor Documentation

◆ ConsecutiveAction()

Generates a new ConsecutiveAction object.

Parameters
mobThe mob to apply this action to.

Definition at line 19 of file ConsecutiveAction.java.

19 {
20 super(mob, 1, true);
21 }

References com.runehive.game.action.Action< T >.mob.

Member Function Documentation

◆ add()

void com.runehive.game.action.ConsecutiveAction< T extends Mob >.add ( Consumer< Action< T > > action)
protected

Adds an action to the actions list.

Parameters
actionThe action.

Definition at line 35 of file ConsecutiveAction.java.

35 {
36 actions.add(action);
37 }

References com.runehive.game.action.Action< T >.Action(), and actions.

Referenced by com.runehive.game.action.impl.TeleportAction.init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ addFirst()

void com.runehive.game.action.ConsecutiveAction< T extends Mob >.addFirst ( Consumer< Action< T > > action)
protected

Adds an action to the actions list.

Parameters
actionThe action.

Definition at line 43 of file ConsecutiveAction.java.

43 {
44 actions.addFirst(action);
45 }

References com.runehive.game.action.Action< T >.Action(), and actions.

Referenced by com.runehive.game.action.impl.TeleportAction.start().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ execute()

void com.runehive.game.action.ConsecutiveAction< T extends Mob >.execute ( )

Definition at line 24 of file ConsecutiveAction.java.

24 {
25 if (!actions.isEmpty()) {
26 Consumer<Action<T>> action = actions.poll();
27 action.accept(this);
28 }
29 }

References actions.

Member Data Documentation

◆ actions

LinkedList<Consumer<Action<T> > > com.runehive.game.action.ConsecutiveAction< T extends Mob >.actions = new LinkedList<>()
private

The list of actions.

Definition at line 11 of file ConsecutiveAction.java.

Referenced by add(), addFirst(), and execute().


The documentation for this class was generated from the following file: