return analyse4OfKing(allCards, plCards);
}
public static List<ThreeOfKind> analyse3OfKing(Set<Card> allCards, PlayingCards plCards){
ThreeOfKind comb = null;
List<ThreeOfKind> combinations= null;
int count = 0;
int i = 0;
CardFace cardFace = null;
for (Card card: allCards){
i++;
if (card.getFace().equals(cardFace))
count++;
else{
if (count == 3){
if (combinations == null) combinations = new ArrayList<ThreeOfKind>();
comb = new ThreeOfKind();
comb.setCombinationList(PairAnalyzer.getListOfCardsByFace(allCards,cardFace));
combinations.add(comb);
}
cardFace = card.getFace();
count = 1;
}
}
if (count == 3){
if (combinations == null) combinations = new ArrayList<ThreeOfKind>();
comb = new ThreeOfKind();
comb.setCombinationList(PairAnalyzer.getListOfCardsByFace(allCards,cardFace));
combinations.add(comb);
}
return combinations;
}