Example #1
0
 /*
  * (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);
     }
   }
 }
Example #2
0
 /*
  * (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));
   }
 }
Example #3
0
 /*
  * (non-Javadoc)
  *
  * @see
  * org.ozsoft.texasholdem.Client#playerUpdated(org.ozsoft.texasholdem.Player
  * )
  */
 public void playerUpdated(Player player) {
   PlayerPanel playerPanel = playerPanels.get(player.getName());
   if (playerPanel != null) {
     playerPanel.update(player);
   }
 }
Example #4
0
 /*
  * (non-Javadoc)
  *
  * @see
  * org.ozsoft.texasholdem.Client#actorRotated(org.ozsoft.texasholdem.Player)
  */
 public void actorRotated(Player actor) {
   setActorInTurn(false);
   actorName = actor.getName();
   setActorInTurn(true);
 }
Example #5
0
 /*
  * (non-Javadoc)
  *
  * @see
  * org.ozsoft.texasholdem.Client#handStarted(org.ozsoft.texasholdem.Player)
  */
 public void handStarted(Player dealer) {
   setDealer(false);
   dealerName = dealer.getName();
   setDealer(true);
 }