Examples of Board


Examples of com.poker.analyst.element.Board

    return false;
  }

  @Override
  public AnalystResult getPreFlopReaction(DataForStrategy dfs) {
    Board board = dfs.getCurrentBoard();
   
    float bb = board.getBigBlind();             
    boolean isFirstCircle = true;
   
    int limpersCount = -1;
    float raiseAmount = 0;
    float maxBet;
    float stackOfFirstRaiser = -1f;
    int callers = 0;
       
    Hand heroHand = new Hand();
    heroHand.setHandCards(board.getPlayingCards().getPlayerCards());
   
    maxBet = 0;
    for (Player pl: board.getPlayers()){
      if (FloatEx.gt4(pl.getBet(), maxBet))
        maxBet = pl.getBet();
    }
           
    if (board.getPlayers().get(board.getHero()).getName().trim() == "")
      isFirstCircle = true;
    else {
      isFirstCircle = false;     
    }

    for (Player player: board.getPlayers()){
      if (FloatEx.equals4(player.getBet() - bb,0f))
        limpersCount ++;
    }
   
    int tmp;         
     
    if (board.getNumOfRaises() != 0){
      if (board.getNumOfRaises() == 1){
        tmp = -1;
        for (Player pl: board.getPlayers())
          if (FloatEx.equals4(pl.getBet(), maxBet)){
            if (stackOfFirstRaiser < 0f) stackOfFirstRaiser = pl.getStack();
            tmp++; 
          }
        raiseAmount = FloatEx.cutFloat2(new Float(maxBet *(3 + tmp)));
        callers = tmp;                           
      }else{
        if (checkHandForHSet(heroHand,1))
          return new AnalystResult(UIReaction.UIR_ACTION_RAISE, StringEx.float2str2(board.getPlayers().get(board.getHero()).getStack()));         
      }         
    }
    else{
      raiseAmount = FloatEx.cutFloat2(new Float(bb *(4 + limpersCount) ) );
    }
   
    if (isFirstCircle){
      switch (board.getPosition()) {
        case EARLY_POSITION:                             
          // no raises
          if (board.getNumOfRaises() == 0){           
            if (checkHandForHSet(heroHand,11) ||
              checkHandForHSet(heroHand,12) ||
              checkHandForHSet(heroHand,21))         
              return new AnalystResult(UIReaction.UIR_ACTION_RAISE, StringEx.float2str2(raiseAmount));
          }else
          if (board.getNumOfRaises() == 1){
            // one raise
            if (callers == 0){
              if (checkHandForHSet(heroHand,11) ||              
                checkHandForHSet(heroHand,12))         
                return new AnalystResult(UIReaction.UIR_ACTION_RAISE, StringEx.float2str2(raiseAmount));

              // call-20
              if ((checkHandForHSet(heroHand,12) || checkHandForHSet(heroHand,13)) &&
                (stackOfFirstRaiser > 20 * maxBet &&
                board.getPlayers().get(board.getHero()).getStack() > maxBet))
                return new AnalystResult(UIReaction.UIR_ACTION_CALL, "");                                                                 
             
            }else{
              if (checkHandForHSet(heroHand,11) ||
                checkHandForHSet(heroHand,12) ||
                checkHandForHSet(heroHand,21))         
                return new AnalystResult(UIReaction.UIR_ACTION_RAISE, StringEx.float2str2(raiseAmount));
            }
          }else{
            if (checkHandForHSet(heroHand,1))
              return new AnalystResult(UIReaction.UIR_ACTION_RAISE, StringEx.float2str2(raiseAmount));
          }
         
          return new AnalystResult(UIReaction.UIR_ACTION_FOLD, "");

                 
        case MIDDLE_POSITION: 
          // no raises
          if (board.getNumOfRaises() == 0){           
            if (checkHandForHSet(heroHand,11) ||
              checkHandForHSet(heroHand,22) ||
              checkHandForHSet(heroHand,21) ||
              checkHandForHSet(heroHand,12))         
              return new AnalystResult(UIReaction.UIR_ACTION_RAISE, StringEx.float2str2(raiseAmount));
          }else
          if (board.getNumOfRaises() == 1){
            // one raise
            if (callers ==0){
              if (checkHandForHSet(heroHand,11) ||               
                checkHandForHSet(heroHand,21))
                         
                return new AnalystResult(UIReaction.UIR_ACTION_RAISE, StringEx.float2str2(raiseAmount));
             
              // call-20
              if ((checkHandForHSet(heroHand,12) || checkHandForHSet(heroHand,13)) &&
                (stackOfFirstRaiser > 20 * maxBet &&
                board.getPlayers().get(board.getHero()).getStack() > maxBet))
                return new AnalystResult(UIReaction.UIR_ACTION_CALL, "");                                     
             
            }else{
              if (checkHandForHSet(heroHand,11) ||
                checkHandForHSet(heroHand,12) ||
                checkHandForHSet(heroHand,21))         
                return new AnalystResult(UIReaction.UIR_ACTION_RAISE, StringEx.float2str2(raiseAmount));
             
              if (checkHandForHSet(heroHand,13) ||
                checkHandForHSet(heroHand,31) ||
                checkHandForHSet(heroHand,33) )         
                return new AnalystResult(UIReaction.UIR_ACTION_CALL, "");
            }
          }else{
            if (checkHandForHSet(heroHand,1))
              return new AnalystResult(UIReaction.UIR_ACTION_RAISE, StringEx.float2str2(raiseAmount));
          }
         
          return new AnalystResult(UIReaction.UIR_ACTION_FOLD, "");
        case LAST_POSITION:  
          // no raises
          if (board.getNumOfRaises() == 0){           
            if (checkHandForHSet(heroHand,11) ||
              checkHandForHSet(heroHand,12) || 
              checkHandForHSet(heroHand,13) ||
              checkHandForHSet(heroHand,21) ||
              checkHandForHSet(heroHand,22) ||
              checkHandForHSet(heroHand,23) ||
              checkHandForHSet(heroHand,31) ||
              checkHandForHSet(heroHand,32) ||
              checkHandForHSet(heroHand,33))
              return new AnalystResult(UIReaction.UIR_ACTION_RAISE, StringEx.float2str2(raiseAmount));
          }else
          if (board.getNumOfRaises() == 1){
            // one raise
            if (callers ==0){             
              if (checkHandForHSet(heroHand,11) ||               
                checkHandForHSet(heroHand,21))                         
                return new AnalystResult(UIReaction.UIR_ACTION_RAISE, StringEx.float2str2(raiseAmount));
             
              // call-20
              if ((checkHandForHSet(heroHand,12) || checkHandForHSet(heroHand,13)) &&
                (stackOfFirstRaiser > 20 * maxBet &&
                board.getPlayers().get(board.getHero()).getStack() > maxBet))
                return new AnalystResult(UIReaction.UIR_ACTION_CALL, "");                                     
             
            }else{
              if (checkHandForHSet(heroHand,11) ||               
                checkHandForHSet(heroHand,12) ||
                checkHandForHSet(heroHand,21) ||               
                checkHandForHSet(heroHand,22) )                         
                return new AnalystResult(UIReaction.UIR_ACTION_RAISE, StringEx.float2str2(raiseAmount));
             
              if (checkHandForHSet(heroHand,13) ||
                checkHandForHSet(heroHand,23) ||
                checkHandForHSet(heroHand,31) ||
                checkHandForHSet(heroHand,33) )         
                return new AnalystResult(UIReaction.UIR_ACTION_CALL, "");
            }
          }else{
            if (checkHandForHSet(heroHand,1))
              return new AnalystResult(UIReaction.UIR_ACTION_RAISE, StringEx.float2str2(raiseAmount));
          }
         
          return new AnalystResult(UIReaction.UIR_ACTION_FOLD, "");
                   
        case BLINDS:      
          // no raises
          if (board.getNumOfRaises() == 0){           
            if (checkHandForHSet(heroHand,11) ||
              checkHandForHSet(heroHand,12) || 
              checkHandForHSet(heroHand,21) ||
              checkHandForHSet(heroHand,22) ||
              checkHandForHSet(heroHand,23) ||
              checkHandForHSet(heroHand,31) ||
              checkHandForHSet(heroHand,32))
              return new AnalystResult(UIReaction.UIR_ACTION_RAISE, StringEx.float2str2(raiseAmount));
          }else
          if (board.getNumOfRaises() == 1){
            // one raise
            if (callers ==0){             
              if (checkHandForHSet(heroHand,11) ||               
                checkHandForHSet(heroHand,21))                         
                return new AnalystResult(UIReaction.UIR_ACTION_RAISE, StringEx.float2str2(raiseAmount));
             
              // call-20
              if ((checkHandForHSet(heroHand,12) || checkHandForHSet(heroHand,13)) &&
                (stackOfFirstRaiser > 20 * maxBet &&
                board.getPlayers().get(board.getHero()).getStack() > maxBet))
                return new AnalystResult(UIReaction.UIR_ACTION_CALL, "");                                   
             
            }else{
              if (checkHandForHSet(heroHand,11) ||               
                checkHandForHSet(heroHand,12) ||
                checkHandForHSet(heroHand,21))                                       
                  return new AnalystResult(UIReaction.UIR_ACTION_RAISE, StringEx.float2str2(raiseAmount));
             
              if (checkHandForHSet(heroHand,13) ||
                checkHandForHSet(heroHand,22) ||
                checkHandForHSet(heroHand,23) ||
                checkHandForHSet(heroHand,31) ||
                checkHandForHSet(heroHand,32) ||
                checkHandForHSet(heroHand,33) )         
                return new AnalystResult(UIReaction.UIR_ACTION_CALL, "");
            }
          }else{
            if (checkHandForHSet(heroHand,1))
              return new AnalystResult(UIReaction.UIR_ACTION_RAISE, StringEx.float2str2(raiseAmount));
          }
         
          return new AnalystResult(UIReaction.UIR_ACTION_FOLD, "");
        default: System.err.println("�� ���������� �������");
          break;
      }  
    }else{
      if (checkHandForHSet(heroHand,1))
        return new AnalystResult(UIReaction.UIR_ACTION_RAISE, StringEx.float2str2(raiseAmount));
     
      if (board.needAmountToCall() < 1.1 * bb)
        return new AnalystResult(UIReaction.UIR_ACTION_CALL, "");     
     
      if (board.getPlayers().get(board.getHero()).getStack() < 2 * bb)
        return new AnalystResult(UIReaction.UIR_ACTION_RAISE, StringEx.float2str2(board.getPlayers().get(board.getHero()).getStack()));
     
      return new AnalystResult(UIReaction.UIR_ACTION_FOLD, "");
    }
   
    return null;

Examples of com.poker.analyst.element.Board

  float koeff = 1;
  @Override
  public boolean maySitToTable(DataForStrategy dfs) {
    boolean result = true;

    Board board = dfs.getCurrentBoard();

    int countSssPlayers = 0;
    if (board == null || board.getPlayers() == null)
    {
      System.err.println(board);
      if (board != null)
        System.err.println(board.getPlayers());
      System.err.println("Xren' kakaja to");
      return false;
    }
  /*  System.out.println("==============before sitting=============");
    System.out.println("Hero: " + board.getPlayers().get(board.getHero()).getStack());
    */
    for (Player player: board.getPlayers()){
  //    System.out.println(player.getStack());
      if (FloatEx.gt4( board.getPlayers().get(board.getHero()).getStack(),player.getStack())){
        if (!FloatEx.equals4(player.getStack(), -2))
          countSssPlayers++;
      }
    }
    if (countSssPlayers > 3){
        logger.log(Level.WARNING,"SSS players > 4");   
                    result = false;
    }     

    if (board.getPlayers().get(board.getHero()).getStack() < 0){
        logger.log(Level.WARNING,"hero stack<0");
        result = false;
    }
    return result;
  }

Examples of com.poker.analyst.element.Board

    return new AnalystResult(null, null);
  }

  @Override
  public ActionBeforePlay getPreparedAction(DataForStrategy dfs) {
    Board board = dfs.getCurrentBoard();
    // CLOSEWINDOW        
    if (FloatEx.gt4(board.getPlayers().get(board.getHero()).getStack(),1.25f * board.getBigBlind() * 30)){
      logger.log(Level.WARNING,"hero have mush money");
      return ActionBeforePlay.ABP_CLOSEWINDOW;
    }
       
    int countSssPlayers = 0;
    for (Player player: board.getPlayers()){
    //  if (FloatEx.gt4(30 * board.getBigBlind(),player.getStack())){
      if (FloatEx.gt4(1 * board.getBigBlind(),player.getStack())){
        if (!FloatEx.equals4(player.getStack(), -2))
          countSssPlayers++;
      }
    }
    if (countSssPlayers > 4){

Examples of com.poker.analyst.element.Board

 
  @Override
  public AnalystResult getPreFlopReaction(DataForStrategy dfs) {


    Board board = dfs.getCurrentBoard();
   
    float bb = board.getBigBlind();
   
    boolean isFirstCircle = true;
   
    int limpersCount = -1;
    float limpersBet = bb;
    float raiseAmount = 0;
   
    float maxBet;
  //  float stackOfFirstRaiser = -1f;
    int callers = 0;
       
    Hand heroHand = new Hand();
    heroHand.setHandCards(board.getPlayingCards().getPlayerCards());
    
    maxBet = 0;
    for (Player pl: board.getPlayers()){
      if (FloatEx.gt4(pl.getBet(), maxBet))
        maxBet = pl.getBet();
    }
    koeff = 1.25f;
    double rand = Math.random();
    if (rand <= 0.2)
      koeff -= 0.05;
    if (rand >= 0.8)
      koeff += 0.05;
         
    if (board.isFirstAuction()){
      isFirstCircle = true;     
      if (!board.getPlayers().get(board.getHero()).getName().trim().equals("") &&
        !board.getPlayers().get(board.getHero()).getName().trim().equals(heroName)){
        logger.log(Level.WARNING,"REASON: heroname != " + board.getPlayers().get(board.getHero()).getName().trim());
        return new AnalystResult(UIReaction.UIR_ACTION_FOLD, "ONLYFOLD");
      }
    }
    else {
      isFirstCircle = false;     
      if (!heroName.equals(board.getPlayers().get(board.getHero()).getName().trim())){
        logger.log(Level.WARNING,"REASON: heroname != " + board.getPlayers().get(board.getHero()).getName().trim());
        return new AnalystResult(UIReaction.UIR_ACTION_FOLD, "ONLYFOLD");
      }
    }
       
    limpersBet = bb;
    if (board.getNumOfRaises() == 1 && maxBet < 2.1f * bb && isFirstCircle){
      limpersBet = maxBet;
      board.setNumOfRaises(0);
    }
   
    for (Player player: board.getPlayers()){
      if (FloatEx.equals4(player.getBet() - limpersBet,0f))
        limpersCount ++;
    }
   
    int tmp;   
    int firstRaiserPosition = -1;
    if (board.getNumOfRaises() != 0){
      if (board.getNumOfRaises() == 1){
        tmp = 0;
        for (int i = 0; i< board.getPlayers().size(); i++){
          if (FloatEx.equals4(board.getPlayers().get(i).getBet(), maxBet)){
            if (firstRaiserPosition  == -1)
              firstRaiserPosition = i;
            tmp++;
          }
        }
        raiseAmount = FloatEx.cutFloat2(new Float(koeff * maxBet * (3 + tmp)));
        callers = tmp;                           
      }else{
        raiseAmount = board.getPlayers().get(board.getHero()).getStack();
      }         
    }
    else{
      raiseAmount = FloatEx.cutFloat2(new Float(koeff * limpersBet *(4 + limpersCount) ) );
    }
    if (raiseAmount > 1f){
      raiseAmount = raiseAmount * 10;
      raiseAmount = FloatEx.cutFloat2(0.1f * Math.round(raiseAmount));
    }
    /*
    if (raiseAmount > dfs.getPlayerMoney() * 2.0f / 3.0f)
        raiseAmount = dfs.getPlayerMoney();
    */
    logger.log(Level.WARNING,"mBet: " + maxBet + ";  limpC: " + limpersCount + ";  rA" + raiseAmount + ";  numRaise: " + board.getNumOfRaises() + "; callers: " + callers);   
    logger.log(Level.WARNING,"position:" + board.getPosition());
    if (isFirstCircle){
      switch (board.getPosition()) {
        case EARLY_POSITION:                             
          // no raises
          if (board.getNumOfRaises() == 0){           
            if (checkHandForHSet(heroHand,11)){
              board.setHeroActionOnTurn(HeroActionOnTurn.HAOT_RAISE);
              logger.log(Level.WARNING,"REASON: (RAISE) heroHand,11");
              return new AnalystResult(UIReaction.UIR_ACTION_RAISE, StringEx.float2str2(raiseAmount));
            }
          }else
          if (board.getNumOfRaises() == 1){
            // one raise
            if (checkHandForHSet(heroHand,21)){
              board.setHeroActionOnTurn(HeroActionOnTurn.HAOT_RERAISE);
              logger.log(Level.WARNING,"REASON: (RAISE) heroHand,21");             
              return new AnalystResult(UIReaction.UIR_ACTION_RAISE, StringEx.float2str2(raiseAmount));
            }
          }else{
            if (checkHandForHSet(heroHand,22)){
              board.setHeroActionOnTurn(HeroActionOnTurn.HAOT_RERAISE);
              logger.log(Level.WARNING,"REASON: (RAISE) heroHand,22");
              return new AnalystResult(UIReaction.UIR_ACTION_RAISE, StringEx.float2str2(raiseAmount));
            }
          }
         
          logger.log(Level.WARNING,"REASON: (FOLD) nothing");
          return new AnalystResult(UIReaction.UIR_ACTION_FOLD, "");
                 
        case MIDDLE_POSITION: 
          if (board.getNumOfRaises() == 0){           
            if (checkHandForHSet(heroHand,12)){
              board.setHeroActionOnTurn(HeroActionOnTurn.HAOT_RAISE);
              logger.log(Level.WARNING,"REASON: (RAISE) heroHand,12");
              return new AnalystResult(UIReaction.UIR_ACTION_RAISE, StringEx.float2str2(raiseAmount));
            }
          }else
          if (board.getNumOfRaises() == 1){
            // one raise
            if (checkHandForHSet(heroHand,21))  {
              board.setHeroActionOnTurn(HeroActionOnTurn.HAOT_RERAISE);
              logger.log(Level.WARNING,"REASON: (RAISE) heroHand,21");
              return new AnalystResult(UIReaction.UIR_ACTION_RAISE, StringEx.float2str2(raiseAmount));
            }
          }else{
            if (checkHandForHSet(heroHand,22)){
              logger.log(Level.WARNING,"REASON: (RAISE) heroHand,22");
              board.setHeroActionOnTurn(HeroActionOnTurn.HAOT_RERAISE);
              return new AnalystResult(UIReaction.UIR_ACTION_RAISE, StringEx.float2str2(raiseAmount));
            }
          }
         
          if (checkHandForHSet(heroHand,41) && FloatEx.gt4(bb * 4.1f, board.needAmountToCall())){
            logger.log(Level.WARNING,"REASON: (CALL) heroHand,41");
            return new AnalystResult(UIReaction.UIR_ACTION_CALL, "");
          }
           
          return new AnalystResult(UIReaction.UIR_ACTION_FOLD, "");
        case LAST_POSITION:            
          if (board.getNumOfRaises() == 0){           
            if (checkHandForHSet(heroHand,13)){
              logger.log(Level.WARNING,"REASON: (RAISE) heroHand,13");
              board.setHeroActionOnTurn(HeroActionOnTurn.HAOT_RAISE);
              return new AnalystResult(UIReaction.UIR_ACTION_RAISE, StringEx.float2str2(raiseAmount));             
            }
            if (checkHandForHSet(heroHand,131) && limpersCount == 0){
              logger.log(Level.WARNING,"REASON: (RAISE) heroHand,131.... limpers = 0");
              return new AnalystResult(UIReaction.UIR_ACTION_RAISE, StringEx.float2str2(raiseAmount));
            }
          }else
          if (board.getNumOfRaises() == 1){
            // one raise
            if (checkHandForHSet(heroHand,21)){
              board.setHeroActionOnTurn(HeroActionOnTurn.HAOT_RERAISE);
              logger.log(Level.WARNING,"REASON: (RAISE) heroHand,21");
              return new AnalystResult(UIReaction.UIR_ACTION_RAISE, StringEx.float2str2(raiseAmount));
            }
          }else{
            if (checkHandForHSet(heroHand,22)){
              logger.log(Level.WARNING,"REASON: (RAISE) heroHand,22");
              board.setHeroActionOnTurn(HeroActionOnTurn.HAOT_RERAISE);
              return new AnalystResult(UIReaction.UIR_ACTION_RAISE, StringEx.float2str2(raiseAmount));
            }
          }
         
          if (checkHandForHSet(heroHand,42) && FloatEx.gt4(bb * 4.1f, board.needAmountToCall())){
            logger.log(Level.WARNING,"REASON: (RAISE) heroHand,42");
            return new AnalystResult(UIReaction.UIR_ACTION_CALL, "");
          }
         
         
         
          logger.log(Level.WARNING,"REASON: (FOLD) nothing");
          return new AnalystResult(UIReaction.UIR_ACTION_FOLD, "");
                   
        case BLINDS:
          if (board.getNumOfRaises() == 0){ 
            if (checkHandForHSet(heroHand,13)){
              logger.log(Level.WARNING,"REASON: (RAISE) heroHand,13");
              board.setHeroActionOnTurn(HeroActionOnTurn.HAOT_RAISE);
              return new AnalystResult(UIReaction.UIR_ACTION_RAISE, StringEx.float2str2(raiseAmount));
            }
            if (checkHandForHSet(heroHand,141) && limpersCount <= 1){
              logger.log(Level.WARNING,"REASON: (RAISE) heroHand,141");
              board.setHeroActionOnTurn(HeroActionOnTurn.HAOT_RAISE);
              return new AnalystResult(UIReaction.UIR_ACTION_RAISE, StringEx.float2str2(raiseAmount));
            }
           
          }else
          if (board.getNumOfRaises() == 1){ 
            if (board.getNextInGamePlayer(firstRaiserPosition) == board.getDealer() ||
              board.getNextInGamePlayer(board.getNextInGamePlayer(firstRaiserPosition)) == board.getDealer() ||
              firstRaiserPosition == board.getDealer() ||
              board.getNextInGamePlayer(board.getDealer()) == firstRaiserPosition){
             
              if (checkHandForHSet(heroHand,31)){
                logger.log(Level.WARNING,"REASON: (RAISE) heroHand,31");
                board.setHeroActionOnTurn(HeroActionOnTurn.HAOT_RERAISE);
                return new AnalystResult(UIReaction.UIR_ACTION_RAISE, StringEx.float2str2(raiseAmount));
              }
            }
            if (checkHandForHSet(heroHand,21)){
              logger.log(Level.WARNING,"REASON: (RAISE) heroHand,21");
              board.setHeroActionOnTurn(HeroActionOnTurn.HAOT_RERAISE);
              return new AnalystResult(UIReaction.UIR_ACTION_RAISE, StringEx.float2str2(raiseAmount));
            }
          }else{
            if (checkHandForHSet(heroHand,21)){
              logger.log(Level.WARNING,"REASON: (RAISE) heroHand,21");
              board.setHeroActionOnTurn(HeroActionOnTurn.HAOT_RERAISE);
              return new AnalystResult(UIReaction.UIR_ACTION_RAISE, StringEx.float2str2(raiseAmount));
            }
          }           
          logger.log(Level.WARNING,"REASON: (FOLD) nothing");
          return new AnalystResult(UIReaction.UIR_ACTION_FOLD, "");
        default: System.err.println("�� ���������� �������");
          break;
      }  
    }else{
      // check for resteal
      boolean isResteal = false;
      int anotherActivePos = -1;
      int tempPosition = board.getHero();     
     
      if ( board.getHeroActionOnTurn() == HeroActionOnTurn.HAOT_RERAISE){
        logger.log(Level.WARNING,"REASON: (ALL) on prev was reraise");
        return new AnalystResult(UIReaction.UIR_ACTION_RAISE, StringEx.float2str2(board.getPlayers().get(board.getHero()).getStack()));
      }
     
      if (board.getActivePlayers() == 2){
        anotherActivePos = board.getNextActivePlayer(board.getHero());
        if(board.getPosition() == Position.LAST_POSITION || board.getPosition() == Position.BLINDS){
          for(int i = 0; i<3; i++){
            tempPosition = board.getNextInGamePlayer(tempPosition);
            if (tempPosition == anotherActivePos){
              isResteal = true;
              break;
            }
          }
        }
      }   
      if (isResteal){
        if (checkHandForHSet(heroHand,32)){
          logger.log(Level.WARNING,"REASON: (RAISE) heroHand,32");
          return new AnalystResult(UIReaction.UIR_ACTION_RAISE, StringEx.float2str2(board.getPlayers().get(board.getHero()).getStack()));         
        }
      }
      else{       
        if (checkHandForHSet(heroHand,23)){
          logger.log(Level.WARNING,"REASON: (RAISE) heroHand,23");
          if (board.getActivePlayers() == 2)
            return new AnalystResult(UIReaction.UIR_ACTION_RAISE, StringEx.float2str2(board.getPlayers().get(board.getHero()).getStack()));
          else
            return new AnalystResult(UIReaction.UIR_ACTION_RAISE, StringEx.float2str2(raiseAmount));
        }
      }           
     

Examples of com.poker.analyst.element.Board

        topCombination = act.analyzeTwoPair(topCombination,true);   
     
     
    }
     
    Board board = dfs.getCurrentBoard();
        Board boardPrev = dfs.getPrevBoard();
        /*
        if (!heroName.equals(board.getPlayers().get(board.getHero()).getName().trim())){
      return new AnalystResult(UIReaction.UIR_ACTION_FOLD, "ONLYFOLD");
    }*/
       
       
        System.out.println(board.getCurrentRound()+ ":  " + topCombination);
        logger.log(Level.WARNING,"StrDraw:  " + straightDraw);
        logger.log(Level.WARNING,"FlushDraw:  " + flushDraw);
        // if on previous round hero stack was calculated incorrectly
        if (board.getPlayers().get(board.getHero()).getStack() < board.getBigBlind() * 2)
      return new AnalystResult(UIReaction.UIR_ACTION_RAISE , StringEx.float2str2(dfs.getPlayerMoney()));
       
        boolean wasRaiseOnPrevRound = false;
        boolean wasRaiseBeforeHero  = false;           
        boolean isFirstCircle    = false;
        boolean wasRaiseHero    = false;
               
        wasRaiseOnPrevRound   = !(FloatEx.equals4(boardPrev.getPlayers().get(boardPrev.getHero()).getBet(), boardPrev.getBigBlind()));
        wasRaiseBeforeHero    = !(FloatEx.equals4(board.getTotal(),0));                 
        wasRaiseHero        = !(FloatEx.equals4(board.getPlayers().get(board.getHero()).getBet(),0));
        isFirstCircle         = !(FloatEx.equals4(board.getPlayers().get(board.getHero()).getBet(),0)) ;
       
       

Examples of com.poker.analyst.element.Board

      else
      if (topCombination instanceof Straight)
        topCombination = act.analyzeStraight(false);         
    }
     
    Board board = dfs.getCurrentBoard();
        Board boardPrev = dfs.getPrevBoard();
        /*
        if (!heroName.equals(board.getPlayers().get(board.getHero()).getName().trim())){
      return new AnalystResult(UIReaction.UIR_ACTION_FOLD, "ONLYFOLD");
    }
    */
       
       
        // if on previous round hero stack was calculated incorrectly
        if (board.getPlayers().get(board.getHero()).getStack() < board.getBigBlind() * 2)
      return new AnalystResult(UIReaction.UIR_ACTION_RAISE , StringEx.float2str2(dfs.getPlayerMoney()));
       
        boolean wasRaiseOnPrevRound = false;
        boolean wasRaiseBeforeHero  = false;                               
        wasRaiseOnPrevRound   = !(FloatEx.equals4(boardPrev.getPlayers().get(boardPrev.getHero()).getBet(), boardPrev.getBigBlind()));
        wasRaiseBeforeHero    = !(FloatEx.equals4(board.getTotal(),0));                 
       
        if (topCombination instanceof Pair)
      topCombination = act.analyzePair(topCombination,true,true,CardFace.FOUR,CardFace.JACK);
                       

Examples of com.poker.analyst.element.Board

      else
      if (topCombination instanceof Straight)
        topCombination = act.analyzeStraight(false);         
    }
     
    Board board = dfs.getCurrentBoard();
        Board boardPrev = dfs.getPrevBoard();
        /*
        if (!heroName.equals(board.getPlayers().get(board.getHero()).getName().trim())){
      return new AnalystResult(UIReaction.UIR_ACTION_FOLD, "ONLYFOLD");
    }
        */
       
        // if on previous round hero stack was calculated incorrectly
        if (board.getPlayers().get(board.getHero()).getStack() < board.getBigBlind() * 2)
      return new AnalystResult(UIReaction.UIR_ACTION_RAISE , StringEx.float2str2(dfs.getPlayerMoney()));
       
        boolean wasRaiseOnPrevRound = false;
        boolean wasRaiseBeforeHero  = false;                               
        wasRaiseOnPrevRound   = !(FloatEx.equals4(boardPrev.getPlayers().get(boardPrev.getHero()).getBet(), boardPrev.getBigBlind()));
        wasRaiseBeforeHero    = !(FloatEx.equals4(board.getTotal(),0));                 
       
        if (topCombination instanceof Pair)
      topCombination = act.analyzePair(topCombination,true,true,CardFace.FOUR,CardFace.JACK);
                       

Examples of com.poker.analyst.element.Board

    public static Board fillInBoard() {

        BoardGenerator.cardsList = generateCardsList();
        final Random random = new Random(new Date().getTime());
        final PlayingCards cards = fillInPlayingCards();
        final Board board = new Board();
        final List<Player> players = new ArrayList<Player>();
        Player player = null;
        final int playerCount = 2 + random.nextInt(8);
        for (int i = 0; i < playerCount; i++) {
            player = new Player();//(, , 0F, true);
            player.setReaction(UIReaction.UIR_ACTION_FOLD);
            player.setStack(10F);
            player.setBet(0F);
            player.setIsInAction(true);
            players.add(player);
        }
        board.setDealer(random.nextInt(playerCount));
        board.setHero(random.nextInt(playerCount));
        board.setPlayers(players);
        board.setPlayingCards(cards);
        board.setCurrentRound(Rounds.PREFLOP);
        return board;
    }

Examples of com.poker.analyst.element.Board

      return this.analystDel.getAllRoundTotal(playWnd);
    }
   
    //CONTROL
    public PlayWindow fillNotFullBoardForBB(final PokerData pdata, PlayWindow playWnd) throws Exception{
      Board board = createBoardShablon(pdata);
      board.setHero(0);
      board.setDealer(findTheButtonPosition(pdata, playWnd));     
     
      BufferedImage[] hStacks = getStacksImages(pdata, playWnd);
        hStacks = getPreparedStacksImages(pdata, hStacks, 2);
        final String[] strStacks = getStacksStrings(pdata, hStacks);
        final Float[] flStacks = getStacksFloats(pdata, strStacks);
        for (int i = 0; i < board.getPlayers().size(); i++) {
            board.getPlayers().get(i).setStack(flStacks[i]);
        }
       
        playWnd.setCurrentRound(Rounds.PREFLOP);
        playWnd.setPreflopBoard(board);

Examples of com.poker.analyst.element.Board

      final BufferParser bufferParser = pdata.getRoomSettings().getBufferParser(pdata.getProgramSettings().getHeroName());
        String strBuffer;
        ParserResult     parserResult = null;
        ParserResult     parserResultPrev = null;
        turnOnConsoleBuffer(pdata, playWnd);
        Board board     = createBoardShablon(pdata);
        Board boardPrev = null;
        Board boardPrevNew = null;
              
        //getting buffer
        strBuffer = getConsoleBuffer(pdata, playWnd);
        parserResult = bufferParser.getParserResult(strBuffer,null);
        if (parserResult == null) throw new ParserException();
       
        if (parserResult.getCurrentRound() != Rounds.PREFLOP){
          boardPrevNew = createBoardShablon(pdata);
          switch (parserResult.getCurrentRound()) {
      case FLOP:
        parserResultPrev = bufferParser.getParserResult(strBuffer,Rounds.PREFLOP);
        break;
      case TURN:
        parserResultPrev = bufferParser.getParserResult(strBuffer,Rounds.FLOP);
        break;
      case RIVER:
        parserResultPrev = bufferParser.getParserResult(strBuffer,Rounds.TURN);
        break;       
      }        
          if (parserResultPrev == null) throw new ParserException();
        }           
        playWnd.setCurrentRound(parserResult.getCurrentRound());
          
        BufferedImage[] hStacks = getStacksImages(pdata, playWnd);
        hStacks = getPreparedStacksImages(pdata, hStacks, 2);
        final String[] strStacks = getStacksStrings(pdata, hStacks);
        final Float[] flStacks = getStacksFloats(pdata, strStacks);

        final Boolean[] activePlayers = getPlayersWithCards(pdata, playWnd);
        final Boolean[] sitoutPlayers = getSitoutPlayers(pdata, playWnd);
        final Boolean[] emptyPlaces = getEmptyPlace(pdata, playWnd);
        final Boolean[] foldPlayers = getFoldPlayers(pdata, playWnd);

        Player player;

        for (int i = 0; i < board.getPlayers().size(); i++) {
            player = board.getPlayers().get(i);
            if (activePlayers[i]) {
                player.setPlayerState(PlayerState.PRS_IN_ACTION);
            } else if (sitoutPlayers[i]) {
                player.setPlayerState(PlayerState.PRS_SITOUT);
            } else if (emptyPlaces[i]) {
                player.setPlayerState(PlayerState.PRS_NONE);
            } else if (foldPlayers[i]) {
                player.setPlayerState(PlayerState.PRS_FOLD);
            } else {
                player.setPlayerState(PlayerState.PRS_SITOUT);
            }
            if (board.getHero() == i) {
                player.setPlayerState(PlayerState.PRS_IN_ACTION);
            }
            player.setStack(flStacks[i]);
        }
        board.setDealer(findTheButtonPosition(pdata, playWnd));
        System.out.println("first auction: " + parserResult.isFirstAuction());
       
        if (parserResult.getCurrentRound() == Rounds.PREFLOP){
          board.setFirstAuction(parserResult.isFirstAuction());
          if (parserResult.isFirstAuction()){ 
            board = setNamesToBoard(pdata, board,bufferParser.getPlayersName(strBuffer),parserResult,true);
          }else{
            for(int i = 0; i< board.getPlayers().size(); i++){
              board.getPlayers().get(i).setName(playWnd.getPreflopBoard().getPlayers().get(i).getName());             
              }
            board = setNamesToBoard(pdata, board,bufferParser.getPlayersName(strBuffer),parserResult,false);
          }
        }else{         
          boardPrevNew.setDealer(board.getDealer());
        if (parserResult.getCurrentRound() == Rounds.FLOP){
                   
          for(int i = 0; i< board.getPlayers().size(); i++){
            boardPrevNew.getPlayers().get(i).setName(playWnd.getPreflopBoard().getPlayers().get(i).getName());
            boardPrevNew.getPlayers().get(i).setPlayerState(board.getPlayers().get(i).getPlayerState());
            }
          boardPrevNew = setNamesToBoard(pdata, boardPrevNew,bufferParser.getPlayersName(strBuffer),parserResultPrev,false);
          for(int i = 0; i< board.getPlayers().size(); i++){
            board.getPlayers().get(i).setName(boardPrevNew.getPlayers().get(i).getName());             
            }
        }
        else{
          for(int i = 0; i< board.getPlayers().size(); i++){
            boardPrevNew.getPlayers().get(i).setName(playWnd.getPreflopBoard().getPlayers().get(i).getName());             
            }
          for(int i = 0; i< playWnd.getPreflopBoard().getPlayers().size(); i++){
            board.getPlayers().get(i).setName(playWnd.getPreflopBoard().getPlayers().get(i).getName());             
            }
        }
        }
       
       
       
       
        /*
        System.out.println("first auction: " + parserResult.isFirstAuction());
        if (parserResult.getCurrentRound() == Rounds.PREFLOP){               
          board.setFirstAuction(parserResult.isFirstAuction());
         
          if (!parserResult.isFirstAuction()){           
            board.setHeroActionOnTurn(playWnd.getPreflopBoard().getHeroActionOnTurn());
           
            for(int i = 0; i< board.getPlayers().size(); i++){
              board.getPlayers().get(i).setName(playWnd.getPreflopBoard().getPlayers().get(i).getName());               
              }
             
          }
          else
          board = setNamesToBoard(board,bufferParser.getPlayersName(strBuffer),parserResult);
        }
        else{
          for(int i = 0; i< board.getPlayers().size(); i++){
            board.getPlayers().get(i).setName(playWnd.getPreflopBoard().getPlayers().get(i).getName());           
            boardPrevNew.getPlayers().get(i).setName(playWnd.getPreflopBoard().getPlayers().get(i).getName());
           
            board.getPlayers().get(i).setReaction(UIReaction.UIR_ACTION_FOLD);
          }
        }*/
        switch(parserResult.getCurrentRound()){
        case PREFLOP :
          playWnd.setPreflopBoard(null);
          playWnd.setFlopBoard(null);
          playWnd.setTurnBoard(null);
          playWnd.setRiverBoard(null);
          break;
        case FLOP :
          boardPrev = playWnd.getPreflopBoard();
          break;
        case TURN :
          boardPrev = playWnd.getFlopBoard();
          break;
        case RIVER :
          boardPrev = playWnd.getTurnBoard();
          break;
      }         
        System.out.println("===========================================================");
       
        if (parserResult.getCurrentRound() != Rounds.PREFLOP){         
          boardPrevNew.setCurrentRound(boardPrev.getCurrentRound());
          boardPrevNew.setHeroActionOnTurn(boardPrev.getHeroActionOnTurn());                   
          boardPrevNew = setParserResultsToBoard(pdata, this, boardPrevNew, parserResultPrev);
        }     
                 
        board = setParserResultsToBoard(pdata, this, board, parserResult);       
               
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.