Examples of PlayerId


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

      psLobbyContext.config = config;
    }

    @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

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

    }

    @Override
    public void onRaise(Raise raise) {
      //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)
View Full Code Here

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

        dispatch(new RaiseEvent(id, movedAmount-callValue, movedAmount));
    }

    @Override
    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())
View Full Code Here

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

    @Override
    public void onPlayerChips(PlayerChips playerChips) {
      try {
        //update sitting players
        PlayerId id = getId(playerChips);
        PlayerState player = getGameState().getPlayer(id);
        if(player!= null && inWinnerZone.get()){
          int prevStack = player.getStack();
          if(prevStack != playerChips.getMoney()){
            dispatch(new WinnerEvent(ImmutableSet.of(new Winner(id,playerChips.getMoney()-prevStack))));
View Full Code Here

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

      }
    }

    @Override
    public void onSit(Sit sit) {
      PlayerId id = getId(sit);
      if(getGameState().getSeatMap().containsValue(id)){
        logger.warn("Ignoring superfluous "+sit+" because player is already sitting in.");
        return;
      }
      Iterator<SeatedPlayer> iter = arrivedPlayers.iterator();
View Full Code Here

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

      if(isPastFirstFakeSitOut || sitOut.getSerial()!=serial){
        if(sitOut.getSerial() == serial && psPlayerContext!=null){
          psPlayerContext.signalSitOut();
          psPlayerContext = null;
        }
        dispatch(new SitOutEvent(new PlayerId(sitOut.getSerial())));
      }else{
        if(sitOut.getSerial()==serial){
          logger.info("Ignoring first fake sitout.");
          isPastFirstFakeSitOut = true;
        }
View Full Code Here

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

    }

    @Override
    public void onDealer(Dealer dealer) {
      List<SeatedPlayer> players = new ArrayList<SeatedPlayer>();
      PlayerId dealerId = null;
      //only send players that actually sit in AND are ingame in the new deal event.
      for(int i:dealtTo){
        PlayerState p = getGameState().getPlayer(new PlayerId(i));
        players.add(new SeatedPlayer(p.getPlayerId(),p.getSeatId(),p.getName(),p.getStack(), p.getBet(), true, false));
        if(p.getSeatId().getId() == dealer.getDealer()){
          dealerId = p.getPlayerId();
        }
      }
View Full Code Here

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

    @Override
    public void onPosition(Position position) {
      if(blindsDone.get() && position.getSerial()!=0){
        //onPosition is also fired for the blinds!
        dispatch(new NextPlayerEvent(new PlayerId(position.getSerial())));
      }
    }
View Full Code Here

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

          //we don't care for hidden cards.
          return;
        }
        cards.add(Card.fromPokersourceInt(c));
      }
      dispatch(new ShowHandEvent(new ShowdownPlayer(new PlayerId(playerCards.getSerial()), cards, "(Unknown)")));
    }
View Full Code Here

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

    public void onChipsPotReset(ChipsPotReset chipsPotReset) {
      inWinnerZone.set(false);
    }

    private PlayerId getId(Id id) {
      return new PlayerId(id.getSerial());
    }
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.