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

Teleports an entity to another part of the world. More...

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

Public Member Functions

void execute ()
 A function representing the unit of work that will be carried out.
 HunterRespawnTask (Npc npc)
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.

Public Attributes

final Npc npc

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

Teleports an entity to another part of the world.

Author
Daniel

Definition at line 15 of file HunterRespawnTask.java.

Constructor & Destructor Documentation

◆ HunterRespawnTask()

com.runehive.game.action.impl.HunterRespawnTask.HunterRespawnTask ( Npc npc)

Definition at line 18 of file HunterRespawnTask.java.

18 {
19 super(false, 80);
20 this.npc = npc;
21 }

References npc.

Member Function Documentation

◆ execute()

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

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

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

Definition at line 37 of file HunterRespawnTask.java.

37 {
38 npc.setVisible(true);
39 cancel();
40 }

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

Here is the call graph for this function:

◆ onSchedule()

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

A function executed on registration.

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

Definition at line 24 of file HunterRespawnTask.java.

24 {
25 Optional<Impling> impling = Impling.forId(npc.id);
26 Optional<Butterfly> butterfly = Butterfly.forId(npc.id);
27
28 if (impling.isPresent()) {
29 setDelay(impling.get().delay);
30 } else butterfly.ifPresent(butterfly1 -> setDelay(butterfly1.delay));
31
32 npc.resetFace();
33 npc.setVisible(false);
34 }

References com.runehive.content.skill.impl.hunter.net.impl.Butterfly.forId(), com.runehive.content.skill.impl.hunter.net.impl.Impling.forId(), npc, and com.runehive.game.task.Task.setDelay().

Here is the call graph for this function:

Member Data Documentation

◆ npc

final Npc com.runehive.game.action.impl.HunterRespawnTask.npc

Definition at line 16 of file HunterRespawnTask.java.

Referenced by execute(), HunterRespawnTask(), and onSchedule().


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