Package org.cspoker.common.elements.table

Examples of org.cspoker.common.elements.table.SeatId


     
      final EnumSet<Card> cards = oldPlayerState.getCards();
      final int stack = oldPlayerState.getStack();
      final boolean hasFolded = oldPlayerState.hasFolded();
      final boolean hasBeenDealt = oldPlayerState.hasBeenDealt();
      final SeatId seat = oldPlayerState.getSeatId();
      final int investment = oldPlayerState.getTotalInvestment();
     
      PlayerState playerState = new AbstractPlayerState() {
       
        @Override
View Full Code Here


//        lobby2.show();
//
//      }
//    });
    final GameWindow w = client.getGui().getGameWindow(tableId, true);
    w.getUser().sitIn(new SeatId(0), 0);
//    final GameWindow w2 = client2.getGui().getGameWindow(tableId, true);
//    w2.getUser().sitIn(new SeatId(2), 0);
    // Run blocking calls in extra thread
    displayexecutor.execute(new Runnable() {
View Full Code Here

          lobby.show();

        }
      });
      final GameWindow w = client.getGui().getGameWindow(tableId, true);
      w.getUser().sitIn(new SeatId(seatId), buyin);
      // Run blocking calls in extra thread
      displayexecutor.execute(new Runnable() {

        public void run() {
          w.show();
View Full Code Here

    tableCompositeLData.minimumHeight = 300;
    tableCompositeLData.minimumWidth = 600;
    setLayoutData(tableCompositeLData);
    setBackgroundMode(SWT.INHERIT_FORCE);
    insertHolderLabel();
    insertPlayerSeatComposite(new SeatId(0));
    insertHolderLabel();
    insertPlayerSeatComposite(new SeatId(1));
    insertHolderLabel();
    insertHolderLabel();
    insertBetArea();
    insertHolderLabel();
    insertBetArea();
    insertHolderLabel();
    // End second row
    insertPlayerSeatComposite(new SeatId(5));
    insertBetArea();
    insertCommunityCardsComposite();
    insertBetArea();
    insertPlayerSeatComposite(new SeatId(2));
    insertHolderLabel();
    insertBetArea();
    insertPotChipsCanvas();
    insertBetArea();
    insertHolderLabel();
    // End fourth row
    insertHolderLabel();
    insertPlayerSeatComposite(new SeatId(4));
    insertHolderLabel();
    insertPlayerSeatComposite(new SeatId(3));
    insertHolderLabel();
   
    for (int i = 0; i < playerSeatComposites.size(); i++) {
      Canvas chipsForPlayerArea = playerBetAreas.get(i);
      PlayerSeatComposite psc = playerSeatComposites.get(i);
View Full Code Here

    // New game
    MutableSeatedPlayer testPlayer;
    try {
      testPlayer = new MutableSeatedPlayer(factory.createNewPlayer("Test", 150),150);
      gameControl.sitIn(new SeatId(4), testPlayer);
    } catch (IllegalActionException e) {
      fail(e.getMessage());
    } catch (IllegalValueException e) {
      fail(e.getMessage());
    }
View Full Code Here

  }

  public final PlayerState getNextSeatedPlayerAfter(PlayerId startPlayer) { 
    ImmutableBiMap<SeatId, PlayerId> seatMap = getSeatMap()
    int maxNbPlayers = getTableConfiguration().getMaxNbPlayers();
    SeatId currentSeat = seatMap.inverse().get(startPlayer);
    PlayerId currentPlayer;
    do{
      currentSeat = new SeatId((currentSeat.getId() + 1) % maxNbPlayers);
      currentPlayer = seatMap.get(currentSeat);
    } while(currentPlayer == null);
    if(currentPlayer.equals(startPlayer)){
      return null;
    }
View Full Code Here

    @Override
    public void onPlayerArrive(PlayerArrive a) {
      SeatedPlayer player = new SeatedPlayer(
          getId(a),
          new SeatId(a.getSeat()),
          a.getName(),
          0,0,false,false);
      arrivedPlayers.add(player);
    }
View Full Code Here

  public synchronized void removePlayer(MutableSeatedPlayer player) {
    if (!hasAsPlayer(player)) {
      throw new IllegalArgumentException(player
          + " is not a player of this table.");
    }
    SeatId seatId = player.getSeatId();
    if (seatId != null) {
      players.remove(seatId);
    }
  }
View Full Code Here

        throw new IllegalArgumentException(player + " can't choose his stack size in Doyle's Game.");
      }
      player.getStack().setValue(tableConfiguration.getDoylesGameStackSize());
    }

    SeatId seatId = new SeatId(0);

    while (isValidSeatId(seatId)
        && players.putIfAbsent(seatId, player) != null) {
      seatId = new SeatId(seatId.getId()+1);
    }
    if (!isValidSeatId(seatId)) {
      throw new PlayerListFullException();
    }
    player.setSeatId(seatId);
View Full Code Here

   * @return The list with all the players at this table.
   */
  public List<MutableSeatedPlayer> getMutableSeatedPlayers() {
    List<MutableSeatedPlayer> playerList = new ArrayList<MutableSeatedPlayer>();
    for (int i = 0; i < getMaxNbPlayers(); i++) {
      MutableSeatedPlayer player = players.get(new SeatId(i));
      if (player != null) {
        playerList.add(player);
      }
    }
    return Collections.unmodifiableList(playerList);
View Full Code Here

TOP

Related Classes of org.cspoker.common.elements.table.SeatId

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.