Beispiel #1
0
 // @Override
 public synchronized void sacarIdPlayer(String ids) {
   for (Player d : getJugadores()) {
     if (d.getId() != null) {
       if (d.getId().equals(ids)) {
         d.setId(null);
         break;
       }
     }
   }
 }
Beispiel #2
0
 // @Override
 public synchronized void asignarIdPlayer(String ids) throws Exception {
   boolean found = false;
   for (Player d : getJugadores()) {
     if (d.getId() == null) {
       d.setId(ids);
       found = true;
       break;
     }
   }
   if (!found) {
     throw new Exception("Partida completa.");
   }
 }