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

Handles digging with a spade. More...

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

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.
 SpadeAction (Player player)
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.

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 digging with a spade.

Author
Daniel.

Definition at line 15 of file SpadeAction.java.

Constructor & Destructor Documentation

◆ SpadeAction()

com.runehive.game.action.impl.SpadeAction.SpadeAction ( Player player)

Definition at line 17 of file SpadeAction.java.

17 {
18 super(player, 2, false);
19 }

Member Function Documentation

◆ execute()

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

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

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

Definition at line 29 of file SpadeAction.java.

29 {
30 boolean found = false;
31
32 if (BarrowsUtility.teleportPlayer(getMob()))
33 found = true;
34
35 if (!found)
36 getMob().send(new SendMessage("You found nothing of interest."));
37 cancel();
38 }

References com.runehive.game.task.Task.cancel(), com.runehive.game.action.Action< T extends Mob >.getMob(), and com.runehive.content.activity.impl.barrows.BarrowsUtility.teleportPlayer().

Here is the call graph for this function:

◆ getName()

String com.runehive.game.action.impl.SpadeAction.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 51 of file SpadeAction.java.

51 {
52 return "Spade Action";
53 }

◆ getWalkablePolicy()

WalkablePolicy com.runehive.game.action.impl.SpadeAction.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 41 of file SpadeAction.java.

41 {
42 return WalkablePolicy.NON_WALKABLE; }

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

◆ onSchedule()

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

A function executed on registration.

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

Definition at line 22 of file SpadeAction.java.

22 {
23 getMob().movement.reset();
24 getMob().animate(new Animation(830));
25 getMob().send(new SendMessage("You start digging..."));
26 }

References com.runehive.game.action.Action< T extends Mob >.getMob().

Here is the call graph for this function:

◆ prioritized()

boolean com.runehive.game.action.impl.SpadeAction.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 46 of file SpadeAction.java.

46 {
47 return false;
48 }

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