Examples of Hand


Examples of com.poker.analyst.element.Hand

    }
    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

Examples of com.poker.analyst.element.Hand

  }
  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

Examples of com.poker.analyst.element.Hand

 
    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

Examples of com.poker.analyst.element.Hand

   
    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

Examples of com.poker.analyst.element.Hand

  @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

Examples of com.poker.analyst.element.Hand

  }
  @Override
  public AnalystResult getTurnReaction(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);
View Full Code Here

Examples of com.poker.analyst.element.Hand

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

Examples of com.svanloon.game.wizard.core.card.Hand

  }

  /**
   */
  public void dealtCards() {
    Hand hand = new Hand();
    CardFinder cardFinder = new WizardCardFinder();
    for(int i = 0; i < round; i++) {
      hand.add(cardFinder.findCard(i));
    }
    addHand(hand);
    this.repaint();
  }
View Full Code Here

Examples of com.threerings.parlor.card.data.Hand

     * @param fadeDuration the amount of time to spend fading in each card
     */
    public void setHand (int size, long fadeDuration)
    {
        // fill hand will null entries to signify unknown cards
        Hand hand = new Hand();
        for (int ii = 0; ii < size; ii++) {
            hand.add(null);
        }
        setHand(hand, fadeDuration);
    }
View Full Code Here

Examples of hand.Hand

    {
        Card cd = new Card(7, 's');
        PlayerController.previousCard = cd;
       
        Cheating cheat = new Cheating();
        Hand hand = new Hand(10);
        //System.out.println(hand);
        ArrayList<Card> cards = new ArrayList<Card>();
        cards.add(new Card(6, 'c'));
        cards.add(new Card(5, 'c'));
        cards.add(new Card(10, 'c'));
        cards.add(new Card(8, 'c'));
        cards.add(new Card(1, 'c'));
        cards.add(new Card(3, 'c'));
        cards.add(new Card(7, 'c'));
        hand.addCards(cards);
       
        assertEquals(cards.get(3), cheat.getNextCard(hand));
    }
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.