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.Pair;
import com.poker.analyst.combination.Straight;
import com.poker.analyst.combination.StraightFlush;
import com.poker.analyst.combination.TwoPairs;
import com.poker.analyst.element.Card;
public class TwoPairAnalyzer {
public static List<TwoPairs> analyseTwoPairs(List<Pair> pairs){
List<TwoPairs> twoPairsList = null;
TwoPairs twoPairs = null;
List<Card> cardList = null;
if (pairs == null || pairs.size() < 2)
return null;
twoPairsList = new ArrayList<TwoPairs>();
for (int i = 0; i< pairs.size(); i++){
for (int j = i+1; j< pairs.size(); j++){
cardList = new ArrayList<Card>();
cardList.addAll(pairs.get(i).getCombinationList());
cardList.addAll(pairs.get(j).getCombinationList());
twoPairs = new TwoPairs();
twoPairs.setCombinationList(cardList);
twoPairsList.add(twoPairs);
}
}
return twoPairsList;
}
}