package com.poker.analyst.analyser.combanalyzer;
import java.util.ArrayList;
import java.util.List;
import com.poker.analyst.combination.Flush;
import com.poker.analyst.combination.FullHouse;
import com.poker.analyst.combination.Pair;
import com.poker.analyst.combination.Straight;
import com.poker.analyst.combination.StraightFlush;
import com.poker.analyst.combination.ThreeOfKind;
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);
}
}
}
return straightFlushList;
}
}