예제 #1
0
파일: GameMatch.java 프로젝트: VuDinh/SA
 public void sendMessageToTeam(Message mes) {
   Player p = getPlayer(mes.getSlotIndex());
   ArrayList<Player> team;
   if (p.getTeam().equals(Team.team1)) team = team1;
   else team = team2;
   for (Iterator it = team.iterator(); it.hasNext(); ) {
     Player player = (Player) it.next();
     // if(player.getSlotIndex()!=request.getSlotIndex())
     if (player.getSlotIndex() != mes.getSlotIndex()) player.getCom().write(mes);
   }
 }
예제 #2
0
파일: GameMatch.java 프로젝트: VuDinh/SA
 public void sendMessageToAll(Message mes) {
   for (Iterator it = team2.iterator(); it.hasNext(); ) {
     Player player = (Player) it.next();
     // if(player.getSlotIndex()!=request.getSlotIndex())
     if (player.getSlotIndex() != mes.getSlotIndex()) player.getCom().write(mes);
   }
   for (Iterator it = team1.iterator(); it.hasNext(); ) {
     Player player = (Player) it.next();
     // if(player.getSlotIndex()!=request.getSlotIndex())
     if (player.getSlotIndex() != mes.getSlotIndex()) player.getCom().write(mes);
   }
 }