コード例 #1
0
ファイル: TeamManager.java プロジェクト: Acampadas21/TeamAPI
 /**
  * Gets the team where a player belongs.
  *
  * @param p The player we are checking.
  * @return The team where the player belongs. Returns null if it doesn't belong to any team.
  */
 public Team getTeamByPlayer(Player p) {
   Team[] teams = listTeams();
   if (teams == null) return null;
   for (Team t : teams) {
     if (t.isInTeam(p)) return t;
   }
   return null;
 }
コード例 #2
0
ファイル: TeamManager.java プロジェクト: Acampadas21/TeamAPI
 /**
  * Removes a team
  *
  * @param t The team that is going to be removed.
  */
 public void deleteTeam(Team t) {
   if (isTeam(t.getName())) {
     teams.remove(t.getName());
   }
 }