Package com.poker.analyst.combination

Examples of com.poker.analyst.combination.Pair


   
    return combinationList.size() == 0 ? null : combinationList;
  }
 
  public static List<Pair> analysePair(Set<Card> allCards, PlayingCards plCards){
    Pair      pair    = null;
    List<Pair>     pairs     = null;         
           
   
    int count      = 0;
    int i = 0;
   
    CardFace cardFace = null;
   
    for (Card card: allCards){
      i++;
      if (card.getFace().equals(cardFace))       
        count++;
      else{
        if (count == 2){
          if (pairs == null) pairs = new ArrayList<Pair>();
          pair = new Pair();
          pair.setCombinationList(getListOfCardsByFace(allCards,cardFace));
          pairs.add(pair);
        }
        cardFace = card.getFace();
        count = 1;
      }       
    }   
    if (count == 2){
      if (pairs == null) pairs = new ArrayList<Pair>();
      pair = new Pair();
      pair.setCombinationList(getListOfCardsByFace(allCards,cardFace));
      pairs.add(pair);
    }
   
    return pairs;
 
View Full Code Here

TOP

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

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.