RuneHive-Tarnish
Neural OSRS Enhancement Framework
Loading...
Searching...
No Matches
LobbyNode.java
1package com.osroyale.content.activity.lobby;
2
3import com.osroyale.content.activity.Activity;
4import com.osroyale.content.activity.GroupActivity;
5import com.osroyale.game.world.entity.mob.player.Player;
6
33
34public abstract class LobbyNode extends GroupActivity {
35 protected final LobbyManager manager;
36 boolean lobby;
37
38 protected LobbyNode(LobbyManager manager) {
39 super(manager.getLobbyCooldown(), manager.getPlayerCapacity());
40 this.manager = manager;
41 }
42
43 @Override
44 protected final void start() {
45 if (manager.canStart(this)) {
46 super.start();
47 onStart();
48 lobby = false;
49 cooldown(manager.getGameCooldown());
50 }
51 }
52
53 protected void onStart() {
54 /* do nothing by default */
55 }
56
57 protected abstract Activity createActivity(Player player);
58
59 protected boolean finished() {
60 return getTicks() == FINISH || getActiveSize() == 0;
61 }
62
63 protected boolean contains(Player player) {
64 return activities.containsKey(player);
65 }
66
67 public boolean inLobby() {
68 return lobby;
69 }
70
71}
GroupActivity(int cooldown, int capacity)