Package org.cspoker.common.api.lobby.holdemtable.event

Examples of org.cspoker.common.api.lobby.holdemtable.event.AllInEvent


      getBettingRules().setBetPlaced(true);
      getBettingRules().setLastBetAmount(Math.max(player.getBetChips().getValue()-getBet(), getBettingRules().getLastBetAmount()));
      playerMadeEvent(player);
      someoneBigAllIn = true;
    }
    gameMediator.publishAllInEvent(new AllInEvent(player.getId(), amount));
   
    BettingRound.logger.info(player.getName() + ": "+" goes all-in with " + Util.parseDollars(player.getMemento().getBetChipsValue()));
  }
View Full Code Here


  @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

    @Override
    public void onCall(Call call) {
      PlayerId id = getId(call);
      int movedAmount = getGameState().getCallValue(id);
      if(movedAmount == getGameState().getPlayer(id).getStack())
        dispatch(new AllInEvent(id, movedAmount));
      else dispatch(new CallEvent(id, movedAmount));
    }
View Full Code Here

      //can also be bet!
      PlayerId id = getId(raise);
      int movedAmount = raise.getAmount();
      int callValue = getGameState().getCallValue(id);
      if(movedAmount == getGameState().getPlayer(id).getStack())
        dispatch(new AllInEvent(id, movedAmount));
      else if(callValue == 0)
        dispatch(new BetEvent(id, movedAmount));
      else
        dispatch(new RaiseEvent(id, movedAmount-callValue, movedAmount));
    }
View Full Code Here

    public void onBlind(Blind blind) {
      PlayerId id = getId(blind);
      int amount = blind.getAmount();
      //      if(getGameState().get)
      if(amount == getGameState().getPlayer(id).getStack())
        dispatch(new AllInEvent(id, amount));
      else if(amount==config.getSmallBlind() || amount==config.getBigBlind())
        dispatch(new BlindEvent(id, amount));
      else throw new IllegalStateException("Unknown blind amount: "+amount+" (sb="+config.getSmallBet()+")");
    }
View Full Code Here

TOP

Related Classes of org.cspoker.common.api.lobby.holdemtable.event.AllInEvent

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.