Examples of GameState


Examples of org.cspoker.client.common.gamestate.GameState

        || gameState.getRound().equals(Round.PREFLOP)
        && actor.equals(gameState.getBigBlind())
        && gameState.getLargestBet() <= gameState
            .getTableConfiguration().getBigBlind();

    GameState checkState = getUnwrappedStateAfterAction();
    if (!newRound) {
      return new NextPlayerState(checkState, new NextPlayerEvent(
          nextToAct.getPlayerId()));
    }
    return getNewRoundState(checkState);
View Full Code Here

Examples of org.cspoker.client.common.gamestate.GameState

    context.betOrRaise(amount);
  }

  @Override
  public GameState getUnwrappedStateAfterAction() {
    GameState betState;
    int stack = gameState.getPlayer(actor).getStack();
    if (stack == amount) {
      betState = new AllInState(gameState, new AllInEvent(actor, amount));
    } else if (stack > amount) {
      betState = new BetState(gameState, new BetEvent(actor, amount));
View Full Code Here

Examples of org.cspoker.client.common.gamestate.GameState

    return betState;
  }

  @Override
  public GameState getStateAfterAction() {
    GameState betState = getUnwrappedStateAfterAction();
    PlayerState nextToAct = betState.getNextActivePlayerAfter(actor);
    if (nextToAct != null) {
      return new NextPlayerState(betState, new NextPlayerEvent(nextToAct
          .getPlayerId()));
    }
    throw new IllegalStateException("Round can't be over after a bet.");
View Full Code Here

Examples of org.cspoker.client.common.gamestate.GameState

    super(playerId, tableId, lobby, buyIn, executor, botListeners);
  }

  @Override
  public void doNextAction() {
    GameState gameState = playerContext.getGameState();
    int deficit = gameState.getDeficit(HandBot.this.botId);

    int nbPlayers = 0;
    for(PlayerState p: gameState.getAllSeatedPlayers()){
      if(p.isActivelyPlaying()) nbPlayers++;
    }
   
    double winPercentage = getWinPercentage(gameState
        .getCommunityCards(), playerContext.getPocketCards(),
        100, nbPlayers - 1);
    if (logger.isDebugEnabled()) {
      logger.debug("Win percentage is " + winPercentage
          + " with " + playerContext.getPocketCards()
          + " and " + gameState.getCommunityCards() + " and "
          + (nbPlayers - 1) + " opponents.");
    }
    double EV = winPercentage
    * (gameState.getGamePotSize() + deficit);
    if (gameState.getRound().equals(Round.PREFLOP)) {
      // be more aggressive on the flop
      EV += EV;
    }
    try {
      if (gameState
          .getNextActivePlayerAfter(HandBot.this.botId) == null) {
        // can only call or fold
        if (deficit <= Math.round(EV)) {
          playerContext.checkOrCall();
        } else {
View Full Code Here

Examples of org.cspoker.client.common.gamestate.GameState

    } else {
      if (nrActions > threshold && !printed) {
        System.out.println("=================\nNEW BOT\n====================");
        printed = true;
      }
      GameState gameState = playerContext.getGameState();
      int deficit = gameState.getDeficit(getId());

      int nbPlayers = 0;
      for(PlayerState p: gameState.getAllSeatedPlayers()){
        if(p.isActivelyPlaying()) nbPlayers++;
      }
     
      double winPercentage = getWinPercentage(gameState
          .getCommunityCards(), playerContext.getPocketCards(),
          100, nbPlayers - 1);
      if (logger.isDebugEnabled()) {
        logger.debug("Win percentage is " + winPercentage
            + " with " + playerContext.getPocketCards()
            + " and " + gameState.getCommunityCards() + " and "
            + (nbPlayers - 1) + " opponents.");
      }
      double EV = winPercentage
      * (gameState.getGamePotSize() + deficit);
      if (gameState.getRound().equals(Round.PREFLOP)) {
        // be more aggressive on the flop
        EV += EV;
      }
      try {
        if (gameState
            .getNextActivePlayerAfter(getId()) == null) {
          // can only call or fold
          if (deficit <= Math.round(EV)) {
            playerContext.checkOrCall();
          } else {
View Full Code Here

Examples of org.newdawn.slick.state.GameState

   * (non-Javadoc)
   *
   * @see com.googlecode.jumpnevolve.graphics.AbstractEngine#getCurrentState()
   */
  public AbstractState getCurrentState() {
    GameState state = this.states.getCurrentState();
    if (!(state instanceof AbstractState)) {
      throw new RuntimeException(
          "The current state does not inherit AbstractState.");
    }
    return (AbstractState) state;
View Full Code Here

Examples of org.seattlegamer.spacegame.core.GameState

    return stateManager;

  }
 
  public @Bean GameState gameState() {
    return new GameState(bus(), resourceCache(), displayMode());
  }
View Full Code Here

Examples of org.terasology.engine.modes.GameState

public class HeadlessStateChangeListener implements StateChangeSubscriber {

    @Override
    public void onStateChange() {
        GameEngine engine = CoreRegistry.get(GameEngine.class);
        GameState state = engine.getState();
        if (state instanceof StateMainMenu) {
            engine.shutdown();
        }
    }
View Full Code Here

Examples of plugin.GameState

    super.receiveData(networkInput, fromIp, fromName, port);

    if (networkInput.startsWith(GAME_UPDATE_TOKEN)
       && gameLoader != null) {

      GameState state = new GameState(networkInput.substring(2));

      for (Player player : playerList) {
        if (player.getName().equals(fromName)) {
          gameLoader.gameStateRecieved(state, player);
        }
View Full Code Here

Examples of ponkOut.GameState

    for (MenuItem item : controlsItems)
      item.restoreDefault();
  }

  public void startGame() {
    nextGameState = new GameState(getListener(), this);
    flyIn(Menu.NEW_GAME, 50.0f);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.