46 lines
967 B
Java
46 lines
967 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.ArrayList;
|
|
|
|
/**
|
|
* @author joethei
|
|
* @version 1.0
|
|
*/
|
|
public class TeamManager {
|
|
|
|
private static final ArrayList<Team> teams = new ArrayList<>();
|
|
|
|
public static ArrayList<Team> getTeams() {
|
|
return teams;
|
|
}
|
|
|
|
public static Team getTeam(String name) {
|
|
for(Team team : teams) {
|
|
if(team.getName().equalsIgnoreCase(name)) return team;
|
|
}
|
|
return null;
|
|
}
|
|
|
|
public static Team getTeam(CustomPlayer p) {
|
|
for(Team team : teams) {
|
|
if(team.isPlayer(p)) return team;
|
|
}
|
|
return null;
|
|
}
|
|
|
|
public static void addTeam(Team team) {
|
|
teams.add(team);
|
|
}
|
|
|
|
public static void removeTeam(Team team) {
|
|
teams.remove(team);
|
|
}
|
|
|
|
} |