// @Override public synchronized void sacarIdPlayer(String ids) { for (Player d : getJugadores()) { if (d.getId() != null) { if (d.getId().equals(ids)) { d.setId(null); break; } } } }
private Player getPlayerId(String wd) { for (Player y : getJugadores()) { if (y.getId() != null) { if (y.getId().equals(wd)) { return y; } } } return null; }
// @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."); } }