RuneHive-Game
Loading...
Searching...
No Matches
com.runehive.game.action.impl.SpellAction Class Reference

Handles the spell casting action. More...

Inheritance diagram for com.runehive.game.action.impl.SpellAction:
Collaboration diagram for com.runehive.game.action.impl.SpellAction:

Public Member Functions

void execute ()
 A function representing the unit of work that will be carried out.
String getName ()
 Gets the name of this action.
WalkablePolicy getWalkablePolicy ()
 Gets the WalkablePolicy of this action.
boolean prioritized ()
 Determines if this action is prioritized.
 SpellAction (Player player, Spell spell, Item item)
 Creates the SpellAction.
Public Member Functions inherited from com.runehive.game.action.Action< T extends Mob >
 Action (T mob, int delay)
 Creates a new Action randomevent.
 Action (T mob, int delay, boolean instant)
 Creates a new Action randomevent.
boolean cancellableInProgress ()
getMob ()
 Gets the player.
Public Member Functions inherited from com.runehive.game.task.Task
Task attach (Object newKey)
 Attaches a new key.
synchronized final void cancel ()
 Cancels all subsequent executions.
synchronized final void cancel (boolean logout)
 Cancels all subsequent executions.
boolean canRun ()
 Determines if the task can be ran.
Optional< Object > getAttachment ()
String getCreationStackTraceStr ()
int getDelay ()
Long getElapsedTimeFromRunStartTime ()
Optional< Long > getRunStartTime ()
long getTaskCreationTime ()
String getTaskId ()
boolean isInstant ()
boolean isRunning ()
void setDelay (int delay)
 Sets the cyclic delay.
void setExecutionTime ()
 Task (boolean instant, int delay)
 Creates a new Task.
 Task (int delay)
 Creates a new Task that doesn't execute instantly.

Protected Member Functions

void onSchedule ()
 A function executed on registration.
Protected Member Functions inherited from com.runehive.game.task.Task
void baseExecute ()
boolean canSchedule ()
 A function executed on registration.
void onCancel (boolean logout)
 A function executed on cancellation.

Private Attributes

final Item item
final Spell spell

Additional Inherited Members

Package Functions inherited from com.runehive.game.task.Task
void onException (Exception e)
 A function executed on thrown exceptions.
void onLoop ()
 A function executed when iterated over.
final synchronized void process ()
synchronized void setRunning (boolean running)

Detailed Description

Handles the spell casting action.

Author
Daniel

Definition at line 13 of file SpellAction.java.

Constructor & Destructor Documentation

◆ SpellAction()

com.runehive.game.action.impl.SpellAction.SpellAction ( Player player,
Spell spell,
Item item )

Creates the SpellAction.

Definition at line 18 of file SpellAction.java.

18 {
19 super(player, 3);
20 this.spell = spell;
21 this.item = item;
22 }

References item, and spell.

Member Function Documentation

◆ execute()

void com.runehive.game.action.impl.SpellAction.execute ( )

A function representing the unit of work that will be carried out.

Reimplemented from com.runehive.game.task.Task.

Definition at line 30 of file SpellAction.java.

30 {
31 cancel();
32 }

References com.runehive.game.task.Task.cancel().

Here is the call graph for this function:

◆ getName()

String com.runehive.game.action.impl.SpellAction.getName ( )

Gets the name of this action.

Returns
The name of this action.

Reimplemented from com.runehive.game.action.Action< T extends Mob >.

Definition at line 35 of file SpellAction.java.

35 {
36 return "spell-action";
37 }

◆ getWalkablePolicy()

WalkablePolicy com.runehive.game.action.impl.SpellAction.getWalkablePolicy ( )

Gets the WalkablePolicy of this action.

Returns
The walkable policy of this action.

Reimplemented from com.runehive.game.action.Action< T extends Mob >.

Definition at line 45 of file SpellAction.java.

45 {
46 return WalkablePolicy.WALKABLE;
47 }

References com.runehive.game.action.policy.WalkablePolicy.WALKABLE.

◆ onSchedule()

void com.runehive.game.action.impl.SpellAction.onSchedule ( )
protected

A function executed on registration.

Reimplemented from com.runehive.game.task.Task.

Definition at line 25 of file SpellAction.java.

25 {
26 spell.execute(getMob(), item);
27 }

References com.runehive.game.action.Action< T extends Mob >.getMob(), item, and spell.

Here is the call graph for this function:

◆ prioritized()

boolean com.runehive.game.action.impl.SpellAction.prioritized ( )

Determines if this action is prioritized.

When making an action prioritized, the next action will be ignored if not queued.

Returns
true if this action is prioritized, false otherwise.

Reimplemented from com.runehive.game.action.Action< T extends Mob >.

Definition at line 40 of file SpellAction.java.

40 {
41 return true;
42 }

Member Data Documentation

◆ item

final Item com.runehive.game.action.impl.SpellAction.item
private

Definition at line 15 of file SpellAction.java.

Referenced by onSchedule(), and SpellAction().

◆ spell

final Spell com.runehive.game.action.impl.SpellAction.spell
private

Definition at line 14 of file SpellAction.java.

Referenced by onSchedule(), and SpellAction().


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