RuneHive-Game
Loading...
Searching...
No Matches
com.runehive.game.task.impl.SteppingStoneTask Class Referenceabstract
Inheritance diagram for com.runehive.game.task.impl.SteppingStoneTask:
Collaboration diagram for com.runehive.game.task.impl.SteppingStoneTask:

Public Member Functions

void execute ()
 A function representing the unit of work that will be carried out.
abstract void onExecute ()
 SteppingStoneTask (Player player, GameObject object)
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 onCancel (boolean logout)
 A function executed on cancellation.
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.

Protected Attributes

int tick

Private Attributes

final GameObject object
final Player player

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

Definition at line 7 of file SteppingStoneTask.java.

Constructor & Destructor Documentation

◆ SteppingStoneTask()

com.runehive.game.task.impl.SteppingStoneTask.SteppingStoneTask ( Player player,
GameObject object )

Definition at line 13 of file SteppingStoneTask.java.

13 {
14 super(true, 0);
15 this.player = player;
16 this.object = object;
17 }

References object, and player.

Member Function Documentation

◆ execute()

void com.runehive.game.task.impl.SteppingStoneTask.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 SteppingStoneTask.java.

30 {
31 onExecute();
32 tick++;
33 }

References onExecute(), and tick.

Here is the call graph for this function:

◆ onCancel()

void com.runehive.game.task.impl.SteppingStoneTask.onCancel ( boolean logout)
protected

A function executed on cancellation.

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

Definition at line 36 of file SteppingStoneTask.java.

36 {
37
38 }

◆ onExecute()

abstract void com.runehive.game.task.impl.SteppingStoneTask.onExecute ( )
abstract

Referenced by execute().

Here is the caller graph for this function:

◆ onSchedule()

void com.runehive.game.task.impl.SteppingStoneTask.onSchedule ( )
protected

A function executed on registration.

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

Definition at line 20 of file SteppingStoneTask.java.

20 {
21 if (!player.getPosition().isWithinDistance(object.getPosition(), 1)) {
22 cancel();
23 return;
24 }
25 }

References com.runehive.game.task.Task.cancel(), and player.

Here is the call graph for this function:

Member Data Documentation

◆ object

final GameObject com.runehive.game.task.impl.SteppingStoneTask.object
private

Definition at line 10 of file SteppingStoneTask.java.

Referenced by SteppingStoneTask().

◆ player

final Player com.runehive.game.task.impl.SteppingStoneTask.player
private

Definition at line 9 of file SteppingStoneTask.java.

Referenced by onSchedule(), and SteppingStoneTask().

◆ tick

int com.runehive.game.task.impl.SteppingStoneTask.tick
protected

Definition at line 11 of file SteppingStoneTask.java.

Referenced by execute().


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