RuneHive-Game
Loading...
Searching...
No Matches
com.runehive.content.lms.LMSGameEvent Class Reference
Inheritance diagram for com.runehive.content.lms.LMSGameEvent:
Collaboration diagram for com.runehive.content.lms.LMSGameEvent:

Public Member Functions

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

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

Constructor & Destructor Documentation

◆ LMSGameEvent()

com.runehive.content.lms.LMSGameEvent.LMSGameEvent ( )

Definition at line 9 of file LMSGameEvent.java.

9 {
10 super(1);
11 }

Member Function Documentation

◆ execute()

void com.runehive.content.lms.LMSGameEvent.execute ( )
protected

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

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

Definition at line 14 of file LMSGameEvent.java.

14 {
15 if(!LMSGame.gameInProgress) return;
16
17 LMSGame.updateInterface();
18 LMSGame.gamePlayers.stream().forEach(player -> LMSGame.processPlayer(player));
19
20 LMSGame.gameTicks++;
21 LMSGame.crateTicks++;
22
23 if (LMSGame.crateTicks == 300) {
24 LMSGame.crateTicks = 0;
25 if(LMSGame.lmsCrate == null)
26 LMSGame.lmsCrate = new LMSCrate();
27 }
28
29 if(LMSGame.gameTicks == 100)
30 LMSGame.setupSafezone();
31
32 if (LMSGame.gameTicks >= 100)
33 LMSGame.handleFog();
34
35 if (--LMSGame.startingTicks >= 0) {
36 if (LMSGame.startingTicks > 0)
37 LMSGame.gamePlayers.stream().forEach(player -> player.speak(LMSGame.startingTicks + ".."));
38 else if (LMSGame.startingTicks == 0) {
39 LMSGame.gamePlayers.stream().forEach(player -> player.speak("FIGHT!"));
40 LMSGame.canAttack = true;
41 }
42 }
43 }

References com.runehive.content.lms.LMSGame.canAttack, com.runehive.content.lms.LMSGame.crateTicks, com.runehive.content.lms.LMSGame.gameInProgress, com.runehive.content.lms.LMSGame.gamePlayers, com.runehive.content.lms.LMSGame.gameTicks, com.runehive.content.lms.LMSGame.handleFog(), com.runehive.content.lms.LMSGame.lmsCrate, com.runehive.content.lms.LMSGame.processPlayer(), com.runehive.content.lms.LMSGame.setupSafezone(), com.runehive.content.lms.LMSGame.startingTicks, and com.runehive.content.lms.LMSGame.updateInterface().

Here is the call graph for this function:

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