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

This loads all the bots into the game world after starting the server. More...

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

Public Member Functions

 BotStartupEvent ()
Public Member Functions inherited from com.runehive.game.task.TickableTask
void execute ()
 A function representing the unit of work that will be carried out.
 TickableTask (boolean instant, int delay)
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 tick ()
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

This loads all the bots into the game world after starting the server.

Author
Daniel

Definition at line 13 of file BotStartupEvent.java.

Constructor & Destructor Documentation

◆ BotStartupEvent()

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

Definition at line 15 of file BotStartupEvent.java.

15 {
16 super(false, 100);
17 }

Member Function Documentation

◆ tick()

void com.runehive.game.task.impl.BotStartupEvent.tick ( )
protected

Reimplemented from com.runehive.game.task.TickableTask.

Definition at line 20 of file BotStartupEvent.java.

20 {
21 if (tick >= Config.MAX_BOTS) {
22 cancel();
23 return;
24 }
25
26 PlayerBot bot = new PlayerBot();
27 bot.register();
28 BotObjective.WALK_TO_BANK.init(bot);
29 }

References com.runehive.game.task.Task.cancel(), com.runehive.Config.MAX_BOTS, com.runehive.content.bot.PlayerBot.register(), tick(), and com.runehive.content.bot.objective.BotObjective.WALK_TO_BANK.

Referenced by tick().

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

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