@Override public void playerUpdated(Player player) { PlayerPanel playerPanel = playerPanels.get(player.getName()); if (playerPanel != null) { playerPanel.update(player); } }
@Override public void joinedTable(TableType type, int bigBlind, List<Player> players) { for (Player player : players) { PlayerPanel playerPanel = playerPanels.get(player.getName()); if (playerPanel != null) { playerPanel.update(player); } } }
/* * (non-Javadoc) * * @see org.ozsoft.texasholdem.Client#joinedTable(int, java.util.List) */ public void joinedTable(int bigBlind, List<Player> players) { for (Player player : players) { PlayerPanel playerPanel = null; try { playerPanel = playerPanels.get(player.getName()); } catch (NullPointerException e) { System.out.println(player.getName()); e.printStackTrace(); System.exit(1); } if (playerPanel != null) { playerPanel.update(player); } } }
@Override public void playerActed(Player player) { String name = player.getName(); PlayerPanel playerPanel = playerPanels.get(name); if (playerPanel != null) { playerPanel.update(player); Action action = player.getAction(); if (action != null) { boardPanel.setMessage(String.format("%s %s.", name, action.getVerb())); if (player.getClient() != this) { boardPanel.waitForUserInput(); } } } else { throw new IllegalStateException(String.format("No PlayerPanel found for player '%s'", name)); } }
/* * (non-Javadoc) * * @see * org.ozsoft.texasholdem.Client#playerActed(org.ozsoft.texasholdem.Player) */ public void playerActed(Player player) { String name = player.getName(); PlayerPanel playerPanel = playerPanels.get(name); if (playerPanel != null) { playerPanel.update(player); Action action = player.getAction(); if (action != null) { boardPanel.setMessage(String.format("%s %s.", name, action.getVerb())); // FIXME: Determine whether actor is the human player (not by // name). if (!name.equals(thisPlayer)) { boardPanel.waitForUserInput(); this.pack(); } } } else { throw new IllegalStateException(String.format("No PlayerPanel found for player '%s'", name)); } }