public class ArcadeLobby
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private static ArcadeMinigame |
minigame
The currently played minigame.
|
private static java.util.Map<java.lang.String,ArcadeMinigame> |
minigameMap
A map of all minigames that can be played, indexed by name.
|
private static java.util.List<org.bukkit.entity.Player> |
playingPlayers
All players in the currently running game.
|
private static java.util.List<ArcadeMinigame> |
queuedMinigames
All minigames that can randomly come up in the next round.
|
private static java.lang.String |
remainingTime
The remaining time of the current game as readable string.
|
private static java.util.List<org.bukkit.entity.Player> |
waitingPlayers
All players waiting for a game to start.
|
Constructor and Description |
---|
ArcadeLobby() |
Modifier and Type | Method and Description |
---|---|
static void |
addPlayerToQueue(org.bukkit.entity.Player player)
Adds a player to the arcade lobby.
|
static void |
endGame()
Ends the current game and puts the players back into queue.
|
static java.util.List<java.lang.String> |
getAllMinigameNames()
Gets a list of all minigame names.
|
static ArcadeMinigame |
getMinigame() |
static int |
getPlayingCount() |
static java.util.List<org.bukkit.entity.Player> |
getPlayingPlayers() |
static java.lang.String |
getRemainingTime() |
static int |
getWaitingCount() |
static java.util.List<org.bukkit.entity.Player> |
getWaitingPlayers() |
static org.bukkit.World |
getWorld() |
static void |
handleAnimationEvent(org.bukkit.event.player.PlayerAnimationEvent event)
Handles the given animation event, that occured in the minigame.
|
static void |
handleDamageEvent(org.bukkit.event.entity.EntityDamageEvent event)
Handles the given damage event, that occured in the minigame.
|
static void |
handleDeathEvent(org.bukkit.event.entity.PlayerDeathEvent event)
Handles the given death event, that occured in the minigame.
|
static void |
handleInteractEvent(org.bukkit.event.player.PlayerInteractEvent event)
Handles the given interact event, that occured in the minigame.
|
static void |
handleMoveEvent(org.bukkit.event.player.PlayerMoveEvent event)
Handles the given move event, that occured in the minigame.
|
static void |
handleProjectileHitEvent(org.bukkit.event.entity.ProjectileHitEvent event)
Handles the given projectile hit event, that occured in the minigame.
|
static void |
handleStartEvent()
Handles the start event, that gets fired when the start countdown ends.
|
static void |
handleTick()
A method that is called every second of the minigame.
|
static boolean |
isWaiting(org.bukkit.entity.Player player)
Checks if a player is waiting for a game to start.
|
static void |
registerMinigame(ArcadeMinigame minigame)
Registers the given minigame.
|
static void |
removePlayer(org.bukkit.entity.Player player)
Removes a player from the arcade lobby.
|
static void |
startGame()
Starts a random new game.
|
static boolean |
startGame(java.lang.String minigameName)
Starts a specific new game.
|
static void |
updateRemainingTime(int seconds) |
private static java.util.List<org.bukkit.entity.Player> waitingPlayers
private static java.util.List<org.bukkit.entity.Player> playingPlayers
private static java.util.Map<java.lang.String,ArcadeMinigame> minigameMap
private static java.util.List<ArcadeMinigame> queuedMinigames
private static ArcadeMinigame minigame
private static java.lang.String remainingTime
public static void registerMinigame(ArcadeMinigame minigame)
minigame
- The minigame to register.public static java.util.List<java.lang.String> getAllMinigameNames()
public static boolean startGame(java.lang.String minigameName)
minigameName
- The name of the minigame to start.ArcadeMinigame.startGame(List)
public static void startGame()
ArcadeMinigame.startGame(List)
public static void endGame()
ArcadeMinigame.endGame()
public static void addPlayerToQueue(org.bukkit.entity.Player player)
player
- The player to add.public static void removePlayer(org.bukkit.entity.Player player)
player
- The player to remove.public static boolean isWaiting(org.bukkit.entity.Player player)
player
- The player to check.public static java.util.List<org.bukkit.entity.Player> getWaitingPlayers()
public static int getWaitingCount()
public static java.util.List<org.bukkit.entity.Player> getPlayingPlayers()
public static int getPlayingCount()
public static ArcadeMinigame getMinigame()
public static java.lang.String getRemainingTime()
public static void updateRemainingTime(int seconds)
seconds
- The new remaining time of the current game in seconds.public static org.bukkit.World getWorld()
public static void handleStartEvent()
public static void handleDeathEvent(org.bukkit.event.entity.PlayerDeathEvent event)
event
- The death event.public static void handleDamageEvent(org.bukkit.event.entity.EntityDamageEvent event)
event
- The damage event.public static void handleProjectileHitEvent(org.bukkit.event.entity.ProjectileHitEvent event)
event
- The projectile hit event.public static void handleInteractEvent(org.bukkit.event.player.PlayerInteractEvent event)
event
- The interact event.public static void handleAnimationEvent(org.bukkit.event.player.PlayerAnimationEvent event)
event
- The animation event.public static void handleMoveEvent(org.bukkit.event.player.PlayerMoveEvent event)
event
- The move event.public static void handleTick()