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

Public Member Functions

int getSkullTime ()
void setSkullTime (int skullTime)
 SkullRemoveTask (Player player)
Public Member Functions inherited from com.runehive.game.task.TickableTask
void execute ()
 A function representing the unit of work that will be carried out.
 TickableTask (boolean instant, int delay)
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 tick ()
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.
void onSchedule ()
 A function executed on registration.

Private Attributes

final Player player
int skullTime

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 6 of file SkullRemoveTask.java.

Constructor & Destructor Documentation

◆ SkullRemoveTask()

com.runehive.game.task.impl.SkullRemoveTask.SkullRemoveTask ( Player player)

Definition at line 12 of file SkullRemoveTask.java.

12 {
13 super(false, 0);
14 this.player = player;
15 }

References player.

Member Function Documentation

◆ getSkullTime()

int com.runehive.game.task.impl.SkullRemoveTask.getSkullTime ( )

Definition at line 37 of file SkullRemoveTask.java.

37 {
38 return skullTime;
39 }

References skullTime.

◆ setSkullTime()

void com.runehive.game.task.impl.SkullRemoveTask.setSkullTime ( int skullTime)

Definition at line 33 of file SkullRemoveTask.java.

33 {
34 this.skullTime = skullTime;
35 }

References skullTime.

◆ tick()

void com.runehive.game.task.impl.SkullRemoveTask.tick ( )
protected

Reimplemented from com.runehive.game.task.TickableTask.

Definition at line 18 of file SkullRemoveTask.java.

18 {
19 if (!player.isValid()) {
20 cancel();
21 return;
22 }
23
24 if (skullTime <= 0) {
25 player.skulling.unskull();
26 cancel();
27 return;
28 }
29
30 skullTime--;
31 }

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

Here is the call graph for this function:

Member Data Documentation

◆ player

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

Definition at line 8 of file SkullRemoveTask.java.

Referenced by SkullRemoveTask(), and tick().

◆ skullTime

int com.runehive.game.task.impl.SkullRemoveTask.skullTime
private

Definition at line 10 of file SkullRemoveTask.java.

Referenced by getSkullTime(), setSkullTime(), and tick().


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