return super.applies() && auction.isOvercall(partnersOpeningBid) && partnersOpeningBid.getTrump().isSuit();
}
@Override
protected Bid prepareBid() {
PointCalculator calculator = new ResponseCalculator(hand, partnersOpeningBid);
if (hand.getSuitLength(partnersOpeningBid.getTrump().asSuit()) >= 3) {
if (calculator.getCombinedPoints() >= 8 && calculator.getCombinedPoints() <= 11) {
return new Bid(partnersOpeningBid.getValue() + 1, partnersOpeningBid.getTrump());
}
if (calculator.getCombinedPoints() >= 12 && calculator.getCombinedPoints() <= 14) {
return new Bid(partnersOpeningBid.getValue() + 2, partnersOpeningBid.getTrump());
}
if (calculator.getCombinedPoints() >= 15) { //Pavlicek is unclear in lesson 7, see tests && partnersOpeningBid.getTrump().isMajorSuit()) {
return new Bid(MAJOR_SUIT_GAME, partnersOpeningBid.getTrump());
}
}
List<Suit> suitsWithAtLeast5Cards = hand.getSuitsWithAtLeastCards(5);
if (suitsWithAtLeast5Cards.size() > 0) {
Suit highestSuitWithAtLeast5Cards = suitsWithAtLeast5Cards.get(0).asSuit();
if (calculator.getCombinedPoints() >= 8 && calculator.getCombinedPoints() <= 11) {
return makeCheapestBid(highestSuitWithAtLeast5Cards);
}
if (calculator.getCombinedPoints() >= 12 && calculator.getCombinedPoints() <= 14) {
Bid bid = makeCheapestBid(highestSuitWithAtLeast5Cards);
return new Bid(bid.getValue() + 1, highestSuitWithAtLeast5Cards);
}
if (calculator.getCombinedPoints() >= 15) { //Pavlicek is unclear in lesson 7, see tests && highestSuitWithAtLeast5Cards.isMajorSuit()) {
return new Bid(MAJOR_SUIT_GAME, highestSuitWithAtLeast5Cards);
}
}
if (haveStopperInEnemySuit()) {
if (calculator.getCombinedPoints() >= 8 && calculator.getCombinedPoints() <= 11) {
return makeCheapestBid(NOTRUMP);
}
if (calculator.getCombinedPoints() >= 12 && calculator.getCombinedPoints() <= 14) {
Bid bid = makeCheapestBid(NOTRUMP);
return new Bid(bid.getValue() + 1, NOTRUMP);
}
if (calculator.getCombinedPoints() >= 15) {
return new Bid(NOTRUMP_GAME, NOTRUMP);
}
}
return null;
}