40 lines
849 B
Java
40 lines
849 B
Java
/*
|
|
* Copyright (c) 2017 univento.eu - All rights reserved
|
|
* You are not allowed to use, distribute or modify this code
|
|
*/
|
|
|
|
package eu.univento.core.api.game;
|
|
|
|
import eu.univento.core.api.player.CustomPlayer;
|
|
|
|
import java.util.LinkedList;
|
|
import java.util.List;
|
|
|
|
/**
|
|
* @author joethei
|
|
* @version 1.0
|
|
*/
|
|
public class PlayerManager {
|
|
|
|
private static final List<CustomPlayer> players = new LinkedList<>();
|
|
|
|
public static List<CustomPlayer> getPlayers() {
|
|
return players;
|
|
}
|
|
|
|
public static void add(CustomPlayer p) {
|
|
players.add(p);
|
|
}
|
|
|
|
public static void remove(CustomPlayer p) {
|
|
if(players.contains(p)) players.remove(p);
|
|
}
|
|
|
|
public static boolean contains(CustomPlayer p) {
|
|
return players.contains(p);
|
|
}
|
|
|
|
public static int size() {
|
|
return getPlayers().size();
|
|
}
|
|
} |