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

Public Member Functions

 HunterTask ()
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.

Static Public Member Functions

static void intialize ()

Protected Member Functions

void execute ()
 A function representing the unit of work that will be carried out.
void onCancel (boolean logout)
 A function executed on cancellation.
Protected Member Functions inherited from com.runehive.game.task.Task
void baseExecute ()
boolean canSchedule ()
 A function executed on registration.
void onSchedule ()
 A function executed on registration.

Static Private Attributes

static boolean RUNNING

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 11 of file HunterTask.java.

Constructor & Destructor Documentation

◆ HunterTask()

com.runehive.game.task.impl.HunterTask.HunterTask ( )

Definition at line 21 of file HunterTask.java.

21 {
22 super(false, 1);
23 }

Referenced by intialize().

Here is the caller graph for this function:

Member Function Documentation

◆ execute()

void com.runehive.game.task.impl.HunterTask.execute ( )
protected

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

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

Definition at line 26 of file HunterTask.java.

26 {
27 final Iterator<Trap> iterator = TrapManager.traps.iterator();
28 while (iterator.hasNext()) {
29 final Trap trap = iterator.next();
30 if (trap == null)
31 continue;
32 if (trap.getOwner() == null || !trap.getOwner().isRegistered())
33 TrapManager.deregister(trap);
34 TrapExecution.setTrapProcess(trap);
35 TrapExecution.trapTimerManagement(trap);
36 }
37
38 if (TrapManager.traps.isEmpty()) {
39 cancel();
40 }
41 }

References com.runehive.game.task.Task.cancel(), com.runehive.content.skill.impl.hunter.trap.TrapManager.deregister(), com.runehive.content.skill.impl.hunter.trap.Trap.getOwner(), com.runehive.game.world.entity.Entity.isRegistered(), com.runehive.content.skill.impl.hunter.trap.TrapExecution.setTrapProcess(), com.runehive.content.skill.impl.hunter.trap.TrapManager.traps, and com.runehive.content.skill.impl.hunter.trap.TrapExecution.trapTimerManagement().

Here is the call graph for this function:

◆ intialize()

void com.runehive.game.task.impl.HunterTask.intialize ( )
static

Definition at line 14 of file HunterTask.java.

14 {
15 if (!RUNNING) {
16 RUNNING = true;
17 World.schedule(new HunterTask());
18 }
19 }

References HunterTask(), RUNNING, and com.runehive.game.world.World.schedule().

Referenced by com.runehive.content.skill.impl.hunter.trap.TrapManager.layTrap().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ onCancel()

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

A function executed on cancellation.

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

Definition at line 44 of file HunterTask.java.

44 {
45 RUNNING = false;
46 }

References RUNNING.

Member Data Documentation

◆ RUNNING

boolean com.runehive.game.task.impl.HunterTask.RUNNING
staticprivate

Definition at line 12 of file HunterTask.java.

Referenced by intialize(), and onCancel().


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