Package org.cspoker.common.elements.player

Examples of org.cspoker.common.elements.player.MutableSeatedPlayer


   *
   */
  public void testTwoPlayersBigBlindAllInCase2(){
    try {

      kenzo = new MutableSeatedPlayer(factory.createNewPlayer("Kenzo", 100), 4);
      cedric = new MutableSeatedPlayer(factory.createNewPlayer("Cedric", 100),100);

      TableConfiguration configuration = new TableConfiguration();
      table = new ServerTable(configuration);
      table.addPlayer(kenzo);
      table.addPlayer(cedric);
View Full Code Here


   * @throws IllegalActionException
   * @see org.cspoker.server.embedded.gamecontrol.TableState#stopPlaying(org.cspoker.common.elements.player.MutablePlayer)
   */
  @Override
  public void stopPlaying(PlayerId id) {
    MutableSeatedPlayer seated = getMutableSeatedPlayer(id);
    serverTable.removePlayer(seated);
   
  }
View Full Code Here

   */
  private void checkIfEndedAndChangeRound() {
    if (round.isRoundEnded()) {
      changeToNextRound();
    } else {
      MutableSeatedPlayer player = game.getCurrentPlayer();
      if (player != null) {
        mediatingTable.publishNextPlayerEvent(new NextPlayerEvent(player.getId()));
      }
    }
  }
View Full Code Here

   * @throws IllegalActionException
   * @see org.cspoker.server.embedded.gamecontrol.TableState#stopPlaying(org.cspoker.common.elements.player.MutableSeatedPlayer)
   */
  @Override
  public void stopPlaying(PlayerId id) {
    MutableSeatedPlayer seated = getMutableSeatedPlayer(id);
    if (!game.getTable().hasAsPlayer(seated)) {
      logger.warn(id + " is not seated at the table.");
      return;
    }

View Full Code Here

   */
  public synchronized HoldemPlayerContext sitIn(SeatId seatId, int buyIn, MutablePlayer player,
      HoldemPlayerListener holdemPlayerListener)
      throws IllegalActionException {
    try {
      HoldemPlayerContext toReturn = tableState.sitIn(seatId, new MutableSeatedPlayer(player, buyIn, true));
      sitInPlayers.put(player.getId(), holdemPlayerListener);
      subscribeHoldemPlayerListener(player.getId(), holdemPlayerListener);
      if (sitInPlayers.size() == 2 && configuration.isAutoDeal() && !tableState.isPlaying()) {
          tableState = tableState.getNextState();
          tableState.deal();
View Full Code Here

   
    public synchronized void run() {
      PokerTable.logger.debug("Player " + player + " auto-fold called.");
      try {
        if (getCurrentTimeOut() == this && tableState.getGame() != null && !cancelled) {
          MutableSeatedPlayer gcPlayer = tableState.getGame().getCurrentPlayer();
          if (gcPlayer!=null && (gcPlayer.getId().equals(player))) {
            PokerTable.logger.debug("Player " + player + " automatically folded.");
            tableState.fold(gcPlayer);
          }
        }
       
View Full Code Here

    }

    // the player with the single highest card gets the odd chips that can't
    // be divided over the winners
    if (pot.getChips().getValue() != 0) {
      MutableSeatedPlayer playerWithHighestSingleCard = winners.get(0);
      Card highestCard = new Hand(playerWithHighestSingleCard
          .getPocketCards()).getHighestRankCard();
      for (MutableSeatedPlayer player : winners) {
        Card otherHighestCard = new Hand(player.getPocketCards())
        .getHighestRankCard();
        int compareSingleBestCard = highestCard
        .compareTo(otherHighestCard);
        if ((compareSingleBestCard > 0)
            || ((compareSingleBestCard == 0) && (otherHighestCard
                .getSuit().compareTo(highestCard.getSuit()) > 0))) {
          playerWithHighestSingleCard = player;
          highestCard = otherHighestCard;
        }
      }
      Showdown.logger
      .info("Odd chips to player with highest card in hand");
      pot.getChips().transferAllChipsTo(
          winnersMap.get(playerWithHighestSingleCard.getId())
          .getGainedChipsPile());
    }
  }
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.player.MutableSeatedPlayer

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.