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

Public Member Functions

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

Private Attributes

final Player player
int time = 20

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 9 of file DuelNotificationTask.java.

Constructor & Destructor Documentation

◆ DuelNotificationTask()

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

Definition at line 14 of file DuelNotificationTask.java.

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

References player.

Member Function Documentation

◆ execute()

void com.runehive.game.task.impl.DuelNotificationTask.execute ( )

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

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

Definition at line 20 of file DuelNotificationTask.java.

20 {
21 if (!ExchangeSession.inSession(player, ExchangeSessionType.DUEL)) {
22 cancel();
23 return;
24 }
25
26 if (time <= 0) {
27 cancel();
28 return;
29 }
30
31 time--;
32
33 if (time % 2 == 0) {
34 player.send(new SendConfig(655, 1));
35 } else {
36 player.send(new SendConfig(655, 0));
37 }
38
39 }

References com.runehive.game.task.Task.cancel(), com.runehive.game.world.entity.mob.player.exchange.ExchangeSessionType.DUEL, com.runehive.game.world.entity.mob.player.exchange.ExchangeSession.inSession(), player, and time.

Here is the call graph for this function:

◆ onCancel()

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

A function executed on cancellation.

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

Definition at line 42 of file DuelNotificationTask.java.

42 {
43 player.send(new SendConfig(655, 0));
44 }

References player.

Member Data Documentation

◆ player

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

Definition at line 11 of file DuelNotificationTask.java.

Referenced by DuelNotificationTask(), execute(), and onCancel().

◆ time

int com.runehive.game.task.impl.DuelNotificationTask.time = 20
private

Definition at line 12 of file DuelNotificationTask.java.

Referenced by execute().


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