RuneHive-Game
Loading...
Searching...
No Matches
PestControlLobby.java
Go to the documentation of this file.
1package com.runehive.content.activity.impl.pestcontrol;
2
3import com.runehive.content.activity.lobby.LobbyManager;
4import com.runehive.content.activity.lobby.LobbyNode;
5import com.runehive.game.world.entity.mob.player.Player;
6import com.runehive.game.world.position.Position;
7
8/**
9 * A {@code PestControlLobby} manages all the {@link PestControlGame} that are
10 * active.
11 *
12 * @author Michael | Chex
13 */
14public class PestControlLobby extends LobbyManager {
15
16 /** The pest control instance, used for managing all activities. */
17 private static final PestControlLobby PEST_CONTROL = new PestControlLobby();
18
19 /** The active game limit. */
20 private static final int GAME_CAPACITY = 1;
21
22 /** The player capacity. */
23 private static final int PLAYER_CAPACITY = 25;
24
25 /** The lobby cooldown timer in ticks (30 seconds). */
26 private static final int LOBBY_COOLDOWN = 50;
27
28 /** The game cooldown timer in ticks (10 minutes). */
29 private static final int GAME_COOLDOWN = 1000;
30
31 /** The minimum amount of players required to start. */
32 private static final int MINIMUM_PLAYERS = 3;
33
34 /** The position inside the pest control boat. */
35 private static final Position INSIDE_BOAT_POSITION = new Position(2661, 2639);
36
37 /** Constructs a new {@link PestControlLobby}. */
41
42 /**
43 * Joins a {@link Player} into a {@link PestControlGame} lobby.
44 *
45 * @param player the player who is joining
46 */
47 public static void joinBoat(Player player) {
48 PEST_CONTROL.enter(player);
49 }
50
51 /** Sequences all the active {@link PestControlGame}. */
52 public static void sequence() {
53 PEST_CONTROL.sequenceActive();
54 }
55
56 @Override
57 protected void onEnter(Player player) {
59 player.message(true, "You have entered the pest control boat.");
60 }
61
62 @Override
63 protected void onLeave(Player player) {
64 player.message(true, "You have left the pest control waiting boat.");
65 }
66
67 @Override
68 protected void exceededPlayerCapacity(Player player) {
69 player.message("This boat doesn't need any more players.");
70 }
71
72 @Override
73 protected void exceededGameCapacity(Player player) {
74 player.message("A game is already active. Please wait for the next boat to depart.");
75 }
76
77 @Override
78 protected LobbyNode createLobby() {
79 return new PestControlGame(PEST_CONTROL);
80 }
81
82}
static final PestControlLobby PEST_CONTROL
The pest control instance, used for managing all activities.
static final int LOBBY_COOLDOWN
The lobby cooldown timer in ticks (30 seconds).
static void sequence()
Sequences all the active PestControlGame.
static final Position INSIDE_BOAT_POSITION
The position inside the pest control boat.
static final int GAME_COOLDOWN
The game cooldown timer in ticks (10 minutes).
static final int MINIMUM_PLAYERS
The minimum amount of players required to start.
static void joinBoat(Player player)
Joins a Player into a PestControlGame lobby.
LobbyManager(int gameCapacity, int playerCapacity, int minimumRequired, int lobbyCooldown, int gameCooldown)
void move(Position position)
Moves the mob to a set position.
Definition Mob.java:340
This class represents a character controlled by a player.
Definition Player.java:125
Represents a single tile on the game world.
Definition Position.java:14