コード例 #1
0
 public Team getTeam(Player p) {
   Team t1 = null;
   for (Team ts : Main.teams.values()) {
     if (ts.getPlayers().contains(p)) {
       t1 = ts;
     }
   }
   return t1;
 }
コード例 #2
0
 public boolean haveTeam(Player p) {
   Team t1 = null;
   for (Team ts : Main.teams.values()) {
     if (ts.getPlayers().contains(p)) {
       t1 = ts;
     }
   }
   if (t1 == null) {
     return false;
   } else {
     return true;
   }
 }