Package org.cspoker.common.elements.player

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


  }

  public final int getUpperRaiseBound(PlayerId playerId) {
    PlayerState player = getPlayer(playerId);
    PlayerState tempPlayer;
    PlayerId tempId = playerId;
    int maxOtherBettableChips=0;
    loop: do{
      //TODO fix infinite loop on double BB
      tempPlayer = getNextActivePlayerAfter(tempId);
      if(tempPlayer==null){
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;
    }
    return getPlayer(currentPlayer);
  }
View Full Code Here

    return getPlayer(currentPlayer);
  }

  public final PlayerState getNextActivePlayerAfter(PlayerId startPlayerId) { 
    PlayerState currentPlayer;
    PlayerId currentPlayerId = startPlayerId;
    do{
      currentPlayer = getNextSeatedPlayerAfter(currentPlayerId);
      if(currentPlayer==null){
        return null;
      }
      currentPlayerId = currentPlayer.getPlayerId();
      if(currentPlayerId.equals(startPlayerId)){
        return null;
      }
    }while(!currentPlayer.isActivelyPlaying());
    return currentPlayer;
  }
View Full Code Here

    });
  }

  @Override
  public AccountContext getAccountContext() {
    return new PSAccountContext(new PlayerId(serial));
  }
View Full Code Here

   * This method is thread-safe.
   *
   * @return A unique player id.
   */
  private PlayerId getUniquePlayerId() {
    return new PlayerId(counter.getAndIncrement());
  }
View Full Code Here

TOP

Related Classes of org.cspoker.common.elements.player.PlayerId

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.