예제 #1
0
  @Override
  public boolean canBidAfter(Contract current, BridgePosition bidder) {
    BridgePosition decl = current.getBridgePosition();

    // kontrakt musi być różny od 4 pasów, bez kontry i rekontry oraz
    // zalicytowany przez przeciwników
    return decl != null
        && current.getStatus() == ContractStatus.NORMAL
        && ((decl == BridgePosition.NORTH || decl == BridgePosition.SOUTH)
                && (bidder == BridgePosition.WEST || bidder == BridgePosition.EAST)
            || (decl == BridgePosition.EAST || decl == BridgePosition.WEST)
                && (bidder == BridgePosition.NORTH || bidder == BridgePosition.SOUTH));
  }
예제 #2
0
 @Override
 public Contract getContractAfter(Contract current, Bidding bidding, BridgePosition bidder) {
   Contract newContract = (Contract) current.clone();
   newContract.setStatus(ContractStatus.DOUBLED);
   return newContract;
 }