* @param wcg
*
* @return Card
*/
public Card playCard(WizardCardGraph wcg) {
Card lead2 = os.getLead();
StringBuilder debug = new StringBuilder();
debug.append(id + " [lead = " + lead2 + "]");
setLeadAndHighCard(lead2, os.getHighCard());
if(hand.size() == 1) {
return hand.iterator().next();
}
Card card;
if(desireToTakeTrick() > 0) {
if(lead2 == null) {
card = leadNormal();
} else if(canTakeTrick) {
if(desireToTakeTrick() < 30) {
debug.append(" take Trick High");
card = takeTrickHigh();
} else {
card = takeTrickMedium();
}
} else {
debug.append(" take sluff low");
card = sluffLow();
}
} else {
if(lead2 == null) {
debug.append(" take sluff low");
card = sluffLow();
} else {
debug.append(" take sluff High");
card = sluffHigh();
}
}
debug.append(" = " + card.toString());
if(false) {
_logger.info(debug.toString());
}
return card;