From 9e2ddeb55321b09086a5a27254197d783847e6e3 Mon Sep 17 00:00:00 2001 From: Leonard Kugis Date: Mon, 25 Apr 2022 18:50:36 +0200 Subject: Initial commit --- src/main/java/com/encrox/zombie/Lobby.java | 72 ++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100755 src/main/java/com/encrox/zombie/Lobby.java (limited to 'src/main/java/com/encrox/zombie/Lobby.java') diff --git a/src/main/java/com/encrox/zombie/Lobby.java b/src/main/java/com/encrox/zombie/Lobby.java new file mode 100755 index 0000000..c33c3c3 --- /dev/null +++ b/src/main/java/com/encrox/zombie/Lobby.java @@ -0,0 +1,72 @@ +package com.encrox.zombie; + +import java.util.ArrayList; + +import org.bukkit.ChatColor; +import org.bukkit.entity.Player; + +public class Lobby { + + private ArrayList players; + private Player creator; + private String identifier; + private Map map; + + public Lobby(Player creator, String identifier, Map map) { + this.creator = creator; + this.identifier = identifier; + this.map = map; + players = new ArrayList(); + players.add(creator); + } + + public String getIdentifier() { + return identifier; + } + + public Player getCreator() { + return creator; + } + + public boolean containsPlayer(Player player) { + if(creator.equals(player)) return true; + return players.contains(player); + } + + public void removePlayer(Player player) { + if(creator.equals(player)) { + for(int i = 0, size = players.size(); i