}
return combinations;
}
public static List<FourOfKind> analyse4OfKing(Set<Card> allCards, PlayingCards plCards){
FourOfKind comb = null;
List<FourOfKind> 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 == 4){
if (combinations == null) combinations = new ArrayList<FourOfKind>();
comb = new FourOfKind();
comb.setCombinationList(PairAnalyzer.getListOfCardsByFace(allCards,cardFace));
combinations.add(comb);
}
cardFace = card.getFace();
count = 1;
}
}
if (count == 4){
if (combinations == null) combinations = new ArrayList<FourOfKind>();
comb = new FourOfKind();
comb.setCombinationList(PairAnalyzer.getListOfCardsByFace(allCards,cardFace));
combinations.add(comb);
}
return combinations;
}