* @param lead
* @param highCard
* @param played
*/
public void played(Card lead, Card highCard, Card played) {
Suit suit = played.getSuit();
Value value = played.getValue();
if(suit.equals(Suit.HEART)) {
setHearts(getHearts() + 1);
} else if(suit.equals(Suit.SPADE)) {
setSpades(getSpades() + 1);
} else if(suit.equals(Suit.CLUB)) {
setClubs(getSpades() + 1);
} else if(suit.equals(Suit.DIAMOND)) {
setDiamonds(getDiamonds() + 1);
} else if(value.equals(Value.WIZARD)) {
setWizards(getWizards() + 1);
} else if(value.equals(Value.JESTER)) {
setJesters(getJesters() + 1);
}
if(suit.equals(Suit.NONE)) {
return;
}
if(lead == null) {
return;
}
Suit leadSuit = lead.getSuit();
if(leadSuit.equals(Suit.NONE)) {
return;
}
// -1 means out of that suit;
if(suit.equals(leadSuit) == false) {
if(leadSuit.equals(Suit.HEART)) {
setHasHearts(false);
} else if(leadSuit.equals(Suit.SPADE)) {
setHasSpades(false);
} else if(leadSuit.equals(Suit.CLUB)) {
setHasClubs(false);
} else if(leadSuit.equals(Suit.DIAMOND)) {
setHasDiamonds(false);
}
}
}