Examples of StraightFlush


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
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.