Package org.cspoker.common.elements.player

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


       */
       @Override
       public List<Integer> getBetProgression() {
         if(betAfterBlindCase){
           List<Integer> result = new ArrayList<Integer>();
           PlayerId lastBettorId = gameState.getLastBettor();
           PlayerState lastBettor = gameState.getPlayer(lastBettorId);
           List<Integer> previousBetProgression = lastBettor.getBetProgression();
           result.addAll(previousBetProgression);
           result.add(event.getAmount());
           return Collections.unmodifiableList(result);
View Full Code Here


    // Start Bot
    SmartClientContext clientContext = new SmartClientContext(server.login(
        "Bot " + botIndex++, "test"));
    final SmartLobbyContext lobbyContext = clientContext
    .getLobbyContext(new DefaultLobbyListener());
    final PlayerId botId = clientContext.getAccountContext().getPlayerID();
    final SingleThreadRequestExecutor executor = SingleThreadRequestExecutor
    .getInstance();
    bot = botFactory.createBot(botId, tableId, lobbyContext, buyin,
        executor,new DefaultBotListener() {
      @Override
View Full Code Here

    HTTPResponse response = new HTTPResponse();
    response.addActionResult(new ActionPerformedEvent<Void>(action1,null));
    response.addActionResult(new ActionPerformedEvent<Void>(action2,null));
   
    Queue<ServerEvent> equeue = new LinkedList<ServerEvent>();
    equeue.add(new HoldemTableTreeEventWrapper(tid, new BetEvent(new PlayerId(5),25)));
    response.addEvents(equeue);
   
    marschaller.marshal(response, output);

    output = new File(baseDir,"http.xml");
View Full Code Here

 
  /**
   * @see org.cspoker.common.api.lobby.holdemtable.listener.HoldemTableListener#onNextPlayer(org.cspoker.common.api.lobby.holdemtable.event.NextPlayerEvent)
   */
  public void onNextPlayer(NextPlayerEvent nextPlayerEvent) {
    PlayerId playerToAct = nextPlayerEvent.getPlayerId();
    tableComposite.proceedToNextPlayer(playerToAct);
    userInputComposite.getGameActionGroup().setVisible(user.getId().equals(playerToAct));
    if (user.getId().equals(playerToAct)) {
      userInputComposite.prepareForUserInput();
    }
View Full Code Here

public class Dealer extends Player {
 
  private static final long serialVersionUID = -7189399705856271060L;

  public Dealer() {
    super(new PlayerId(-1), "Dealer");
  }
View Full Code Here

  public BucketRollOut(GameState gameState, PlayerId botId, OpponentModel model) {
    super(gameState, botId);
    this.model = model;
    Builder<PlayerId, double[]> builder = new ImmutableMap.Builder<PlayerId, double[]>();
    for (PlayerState opponentThatCanWin : activeOpponents) {
      PlayerId playerId = opponentThatCanWin.getPlayerId();
      double[] bucketProbs = model.getShowdownProbabilities(gameState, playerId);
      builder.put(playerId, bucketProbs);
    }
    bucketProbs = builder.build();
  }
View Full Code Here

          .getStack(),0, tokens);
    } else {
      try {
        GameState nextState = action.getAction().getStateAfterAction();
        // expand further
        PlayerId nextToAct = nextState.getNextToAct();
        if (nextToAct.equals(botId)) {
          // go to next player node
          return new BotActionNode(botId,
              nextState, config, config.getSampler(), tokens, searchId, visitors);
        } else {
          return  new OpponentActionNode(
View Full Code Here

    //TODO check what if bot allin and 2 other players?
    int stealable = 0;
    Set<PlayerState> players = gameState.getAllSeatedPlayers();
    double rakeFactor = 1-gameState.getTableConfiguration().getRake();
    for(PlayerState p:players){
      PlayerId opponent = p.getPlayerId();
      if(p.isActivelyPlaying() && !opponent.equals(botId)){
        int callValue = gameState.getCallValue(opponent);
        stealable += rakeFactor*(Math.min(botStack, p.getStack()-callValue)+callValue);
      }
    }
    return botStack+stealable
View Full Code Here

      public void setAvatar(byte[] avatar) {

      }

      public PlayerId getPlayerID() {
        return new PlayerId(0);
      }

    });
    pokerTable.subscribeHoldemTableListener(events);
    try {
View Full Code Here

    nbActionsPerPlayer.put(playerId, nbActions);
  }

  @Override
  public void visitAllInState(AllInState allInState) {
    PlayerId playerId = allInState.getEvent().getPlayerId();
    signalAction(playerId);
    gamePlayerAction(allInState, playerId);
  }
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.