Package com.poker.analyst.combination

Examples of com.poker.analyst.combination.ThreeOfKind


   
    return analyse4OfKing(allCards, plCards);
  }
 
  public static List<ThreeOfKind> analyse3OfKing(Set<Card> allCards, PlayingCards plCards){
    ThreeOfKind        comb      = null;
    List<ThreeOfKind>     combinations= null;             
               
    int count      = 0;
    int i = 0;
   
    CardFace cardFace = null;
   
    for (Card card: allCards){
      i++;
      if (card.getFace().equals(cardFace))       
        count++;
      else{
        if (count == 3){
          if (combinations == null) combinations = new ArrayList<ThreeOfKind>();
          comb = new ThreeOfKind();
          comb.setCombinationList(PairAnalyzer.getListOfCardsByFace(allCards,cardFace));
          combinations.add(comb);
        }
        cardFace = card.getFace();
        count = 1;
      }       
    }   
    if (count == 3){
      if (combinations == null) combinations = new ArrayList<ThreeOfKind>();
      comb = new ThreeOfKind();
      comb.setCombinationList(PairAnalyzer.getListOfCardsByFace(allCards,cardFace));
      combinations.add(comb);
    }
   
    return combinations;
  }
View Full Code Here

TOP

Related Classes of com.poker.analyst.combination.ThreeOfKind

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.