Package org.cspoker.client.common.gamestate.modifiers

Examples of org.cspoker.client.common.gamestate.modifiers.AllInState


  @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));
    } else throw new IllegalStateException("Can't bet amount: "+amount+", with stack: " + stack);
    return betState;
  }
View Full Code Here


    int deficit = largestBet - oldBet;
    int movedAmount = deficit + amount;

    GameState raiseState;
    if (movedAmount >= stack) {
      raiseState = new AllInState(gameState, new AllInEvent(actor, movedAmount));
    } else {
      raiseState = new RaiseState(gameState, new RaiseEvent(actor, amount, movedAmount));
    }
    return raiseState;
  }
View Full Code Here

    int stack = actorState.getStack();
    int bet = actorState.getBet();   

    GameState state;
    if (stack <= largestBet - bet) {
      state = new AllInState(gameState, new AllInEvent(actor, stack));
    } else {
      state = new CallState(gameState, new CallEvent(actor, largestBet - bet));
    }
    return state;
  }
View Full Code Here

        getFoldProbability(gameState), getCallProbability(gameState),
        getRaiseProbability(gameState));
  }

  public void addAllIn(GameState gameState, AllInEvent allInEvent) {
    AllInState newState = new AllInState(gameState, allInEvent);
    if (gameState.hasBet()) {
      if (newState.getRaise() > 0) {
        ++nbRaise;
      } else {
        ++nbCall;
      }
      ++totalBet;
View Full Code Here

    super.onCall(callEvent);
  }
 
  @Override
  public void onAllIn(AllInEvent allInEvent) {
    tableState.setGameState(new AllInState(tableState.getGameState(), allInEvent));
    super.onAllIn(allInEvent);
  }
View Full Code Here

TOP

Related Classes of org.cspoker.client.common.gamestate.modifiers.AllInState

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.