Package com.poker.analyst.element

Examples of com.poker.analyst.element.Hand


    float leveledAmount = board.getLeveledAmount();
    float bNeedToCallValue = board.needAmountToCall();
   
    float raiseForLimpers  = 0;
   
    Hand heroHand = new Hand();
    heroHand.setHandCards(board.getPlayingCards().getPlayerCards());
   
       
   
    // TODO [SSS-PF] find limpers count;       
    int   limpersCount  = -1
View Full Code Here


    return cardValues;
  }
 
  public Card getKicker(List<CardValue> listCardValues){
   
    Hand hand = new Hand(availableCombinations.getPlCards().getPlayerCards());
    Card kicker = null;   
    
    if (hand == null) return null;
    if (hand.getHandCards() == null) return null;
    if (hand.getHandCards().length != 2) return null;
   
    if (listCardValues == null || listCardValues.size() == 0){
      if (hand.getHandCards()[0].getFace().getSerialNumber() >=
        hand.getHandCards()[1].getFace().getSerialNumber())
        return hand.getHandCards()[0];
      else
        return hand.getHandCards()[1];
    }
    if (listCardValues.size() == 2){
      return null;
    }
   
    boolean isNotInCV = true;
    for (int q = 0; q<2; q++){
      isNotInCV = true;
      for(CardValue cv: listCardValues){
        if (cv.getCard().equals(hand.getHandCards()[q]))
          isNotInCV = false;
      }
      if (isNotInCV)
        return hand.getHandCards()[q];     
    }   
    return kicker;
  }
View Full Code Here

    return null;
  }
 
  public Flush analyzeFlush(boolean isDraw){   
   
    Hand hand = new Hand(availableCombinations.getPlCards().getPlayerCards());
    Flush topFlush = null;
    List<CardValue> cardValues = null;
    List<Flush> listFlushes;
    if (isDraw)
      listFlushes = availableCombinations.getFlushDraws();
View Full Code Here

    }
    return topFlush;
 
  public Straight analyzeStraight(boolean isDraw){   
   
    Hand hand = new Hand(availableCombinations.getPlCards().getPlayerCards());
    Straight topStraight = null;
    List<CardValue> cardValues = null;
    List<Straight> listStraights;
    if (isDraw)
      listStraights = availableCombinations.getStraightOesds();
View Full Code Here

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

    }
    return topStraight;
 
 
  public Combination cutNotHeroCombination(Combination combination){
    Hand hand = new Hand(availableCombinations.getPlCards().getPlayerCards());
    if (combination == null) return null;
    List<CardValue> cardValues = getCardValuesFromComb(combination, hand);
    if (cardValues == null || cardValues.size() == 0)
      return null;   
   
View Full Code Here

  }
  public Combination analyzePair(Combination combination,
                  boolean isTop, boolean isMiddle,
                  CardFace kickerTop,CardFace kickerMiddle){ 
   
    Hand hand = new Hand(availableCombinations.getPlCards().getPlayerCards());
    Pair pair = (Pair)combination;
    List<CardValue> cardValues = getCardValuesFromComb(combination, hand);
    Card kicker;
   
    if (cardValues == null)
View Full Code Here

 
    return combination;
  }
  public Combination analyzeTwoPair(Combination combination, boolean isMiddle){ 

    Hand hand = new Hand(availableCombinations.getPlCards().getPlayerCards());
    TwoPairs pair = (TwoPairs) combination;
    List<CardValue> cardValues = getCardValuesFromComb(combination, hand);
    if (cardValues == null)
      combination = null;
    else
View Full Code Here

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

  @Override
  public AnalystResult getFlopReaction(DataForStrategy dfs) {   
   
    AvailableCombinations availcomb =  new AvailableCombinations(dfs.getCurrentBoard().getPlayingCards());
    AvailableCombinationsTools act = new AvailableCombinationsTools(availcomb);
    Hand hand = new Hand(dfs.getCurrentBoard().getPlayingCards().getPlayerCards());
       
    Combination topCombination = act.getTopCombination();
   
    Flush    flushDraw     = act.analyzeFlush(true)
    Straight straightDraw  = act.analyzeStraight(true);
   
    if (availcomb.getFlushDraws() != null && availcomb.getFlushDraws().size() != 0 &&
      flushDraw == null)
      if (topCombination.getCombinationValue() < new Flush().getCombinationValue())
        topCombination = null;
    if (availcomb.getStraightOesds() != null && availcomb.getStraightOesds().size() != 0 &&
        straightDraw == null)
        if (topCombination.getCombinationValue() < new Straight().getCombinationValue())
          topCombination = null;
     
     
    topCombination = act.cutNotHeroCombination(topCombination);   
    if (topCombination != null){
             
      if (topCombination instanceof HighCard)
        topCombination = null;
     
      if (topCombination instanceof Flush)
        topCombination = act.analyzeFlush(false);
      else
      if (topCombination instanceof Straight)
        topCombination = act.analyzeStraight(false);   
      if (topCombination instanceof TwoPairs)
        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)) ;
       
       
       
        if (wasRaiseOnPrevRound){
          if (topCombination instanceof Pair)
        topCombination = act.analyzePair(topCombination,true,true,CardFace.FOUR,CardFace.JACK);
        }else
        {
          if (topCombination instanceof Pair)
        topCombination = act.analyzePair(topCombination,false,true,CardFace.JACK,CardFace.JACK);
        }
               
        float heroMoney = dfs.getPlayerMoney();
        float total    = dfs.getTotalBank();
       
        float raiseAmount = 0f;
        float koeff = 2.0f/3.0f;
       
       
        //кто-то ререйзнул
        List<CardValue> cardvalues;
        if (wasRaiseHero ){
          if (dfs.getPlayerMoney() > board.getPlayers().get(board.getHero()).getBet()){
            if (availcomb.getAllCards().contains(new Card(Suit.clubs, CardFace.ACE)) ||
            availcomb.getAllCards().contains(new Card(Suit.diamonds, CardFace.ACE)) ||
            availcomb.getAllCards().contains(new Card(Suit.spades, CardFace.ACE)) ||
            availcomb.getAllCards().contains(new Card(Suit.hearts, CardFace.ACE))){
             
           
              if (topCombination instanceof Pair){
                // if pair is middle && Ace exists => fold
                //cardvalues = act.getCardValuesFromComb(topCombination, hand);               
                //if (cardvalues.get(0).getCard().getFace() != CardFace.ACE)
                if (hand.getHandCards()[0].getFace() != CardFace.ACE &&
                  hand.getHandCards()[1].getFace() != CardFace.ACE)
                  topCombination = null;               
              }
            }           
          }
        }
View Full Code Here

TOP

Related Classes of com.poker.analyst.element.Hand

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.