RuneHive-Game
Loading...
Searching...
No Matches
com.runehive.game.task.impl.DoubleExperienceEvent Class Reference

An randomevent which starts double experience for 1 hour. More...

Inheritance diagram for com.runehive.game.task.impl.DoubleExperienceEvent:
Collaboration diagram for com.runehive.game.task.impl.DoubleExperienceEvent:

Public Member Functions

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

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

An randomevent which starts double experience for 1 hour.

Author
Daniel | Obey

Definition at line 12 of file DoubleExperienceEvent.java.

Constructor & Destructor Documentation

◆ DoubleExperienceEvent()

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

Definition at line 14 of file DoubleExperienceEvent.java.

14 {
15 super(100);
16 }

Member Function Documentation

◆ execute()

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

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

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

Definition at line 19 of file DoubleExperienceEvent.java.

19 {
20 if (!WellOfGoodwill.isActive()) {
21 cancel();
22 return;
23 }
24
25 WellOfGoodwill.activeTime++;
26
27 if (WellOfGoodwill.activeTime == 15) {
28 World.sendMessage("<col=2b58a0>WOG</col>: 15 Minutes left until the well is expired.");
29 } else if (WellOfGoodwill.activeTime == 25) {
30 World.sendMessage("<col=2b58a0>WOG</col>: 5 Minutes left until the well is expired.");
31 } else if (WellOfGoodwill.activeTime == 30) {
32 cancel();
33 }
34 }

References com.runehive.content.WellOfGoodwill.activeTime, com.runehive.game.task.Task.cancel(), com.runehive.content.WellOfGoodwill.isActive(), and com.runehive.game.world.World.sendMessage().

Here is the call graph for this function:

◆ onCancel()

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

A function executed on cancellation.

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

Definition at line 37 of file DoubleExperienceEvent.java.

37 {
38 World.sendMessage("<col=2b58a0>WOG</col>: The well has expired and needs replenishing!");
39 WellOfGoodwill.activeTime = -1;
40 WellOfGoodwill.CONTRIBUTION = 0;
41 }

References com.runehive.content.WellOfGoodwill.activeTime, com.runehive.content.WellOfGoodwill.CONTRIBUTION, and com.runehive.game.world.World.sendMessage().

Here is the call graph for this function:

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