Package org.cspoker.common.elements.player

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


    gamePlayerAction(allInState, playerId);
  }

  @Override
  public void visitBetState(BetState betState) {
    PlayerId playerId = betState.getEvent().getPlayerId();
    signalAction(playerId);
    gamePlayerAction(betState, playerId);
  }
View Full Code Here


    gamePlayerAction(betState, playerId);
  }

  @Override
  public void visitBlindState(BlindState blindState) {
    PlayerId playerId = blindState.getEvent().getPlayerId();
    signalAction(playerId);
    if(playerId.equals(blindState.getBigBlind())){
      gamePlayerBigBlind(playerId);
    }else if(playerId.equals(blindState.getSmallBlind())){
      gamePlayerSmallBlind(playerId);
    }else throw new UnsupportedOperationException("Can't handle additional blinds in Prolog model.");
  }
View Full Code Here

    }else throw new UnsupportedOperationException("Can't handle additional blinds in Prolog model.");
  }

  @Override
  public void visitCallState(CallState callState) {
    PlayerId playerId = callState.getEvent().getPlayerId();
    signalAction(playerId);
    gamePlayerAction(callState, playerId);
  }
View Full Code Here

    gamePlayerAction(callState, playerId);
  }

  @Override
  public void visitCheckState(CheckState checkState) {
    PlayerId playerId = checkState.getEvent().getPlayerId();
    signalAction(playerId);
    gamePlayerAction(checkState, playerId);
  }
View Full Code Here

    gamePlayerAction(checkState, playerId);
  }

  @Override
  public void visitFoldState(FoldState foldState) {
    PlayerId playerId = foldState.getEvent().getPlayerId();
    signalAction(playerId);
    gamePlayerAction(foldState, playerId);
  }
View Full Code Here

  }

  @Override
  public void visitRaiseState(RaiseState raiseState) {
    RaiseEvent event = raiseState.getEvent();
    PlayerId playerId = event.getPlayerId();
    signalAction(playerId);
    gamePlayerAction(raiseState, playerId);
  }
View Full Code Here

  protected void start() throws RemoteException, LoginException, IllegalActionException {
    RemoteServerContext conn = server.login("foobar", "foobar");
    SmartClientContext clientContext = new SmartClientContext(conn);
    final SmartLobbyContext lobbyContext = clientContext.getLobbyContext(new DefaultLobbyListener());
    final PlayerId botId = clientContext.getAccountContext().getPlayerID();
    final SingleThreadRequestExecutor executor = SingleThreadRequestExecutor.getInstance();
    final TableId tableId = new TableId(0);
    bot = botFactory.createBot(botId, tableId, lobbyContext, 200000, executor, new DefaultBotListener() {
      @Override
      public void onSitOut(SitOutEvent sitOutEvent) {
        if(botId.equals(sitOutEvent.getPlayerId())){
          logger.info("Sitting in again after "+sitOutEvent);
          bot.reSitIn();
        }
      }
    }, new ProfitListener(1,new ProfitInfo(){
View Full Code Here

      @Override
      public void onNewPocketCards(NewPocketCardsEvent newPocketCardsEvent) {
        logger.info(newPocketCardsEvent);
      }
     
    },holdemPlayerListener)), gameStateContainer, new PlayerId(serial));
    this.transListener = new TranslatingListener();
    this.gameStateContainer = gameStateContainer;
    this.conn.addListeners(transListener);
    if(tableContext.pastInitialBuyIn){
      conn.sendRemote(new Rebuy(serial, game_id, buyIn));
View Full Code Here

  public void betOrRaise(int amount) throws IllegalActionException, RemoteException {
    if(!isSittingIn) {
      throw new IllegalActionException("Can't act when not sitting in.");
    }
    try {
      int callValue = gameStateContainer.getGameState().getCallValue(new PlayerId(serial));
      conn.sendRemote(new Raise(serial, game_id, callValue+amount));
    } catch (JSONException e) {
      throw new IllegalActionException(e);
    }
  }
View Full Code Here

    @Override
    public void onPlayerCards(PlayerCards playerCards) {
      //don't consider card 255 which is a hidden card
      if(playerCards.getSerial() == serial
          && gameStateContainer.getGameState().getPlayer(new PlayerId(serial)).getCards().size()==0){
        Card card0 = Card.fromPokersourceInt(playerCards.getCards()[0]);
        Card card1 = Card.fromPokersourceInt(playerCards.getCards()[1]);
        smartListener.onNewPocketCards(new NewPocketCardsEvent(EnumSet.of(card0, card1)));
      }
    }
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.