Package com.poker.analyst.combination

Examples of com.poker.analyst.combination.StraightFlush


import com.poker.analyst.element.Card;

public class StraightFlushAnalyzer {
  public static List<StraightFlush> analyseStraightFlush(List<Flush> flushs, List<Straight> straights){
    List<StraightFlush> straightFlushList = null;
    StraightFlush    straightFlush = null;
   
    if (flushs == null || straights == null)
      return null;
   
    boolean equals;
    for (Flush flush: flushs){
      for (Straight straight: straights){
        equals = true;
        for(int i = 0; i< flush.getCombinationList().size(); i++){
          if (!flush.getCombinationList().get(i).getFace().equals(
              straight.getCombinationList().get(i).getFace())){
            equals = false;
            break;         
          }
        }
        if (equals){
          straightFlush = new StraightFlush();
          straightFlush.setCombinationList(flush.getCombinationList());
          if (straightFlushList == null)
            straightFlushList = new ArrayList<StraightFlush>();
         
          straightFlushList.add(straightFlush);
         
View Full Code Here

TOP

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

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.