Package org.gnubridge.core.bidding.rules

Source Code of org.gnubridge.core.bidding.rules.Open1NT

package org.gnubridge.core.bidding.rules;

import org.gnubridge.core.Hand;
import org.gnubridge.core.bidding.Auctioneer;
import org.gnubridge.core.bidding.Bid;
import org.gnubridge.core.bidding.PointCalculator;
import org.gnubridge.core.deck.NoTrump;

public class Open1NT extends BiddingRule {

  private PointCalculator pc;

  public Open1NT(Auctioneer a, Hand h) {
    super(a, h);
    pc = new PointCalculator(hand);
  }

  @Override
  protected Bid prepareBid() {
    return new Bid(1, NoTrump.i());
  }

  @Override
  protected boolean applies() {
    return auction.isOpeningBid() && pc.getHighCardPoints() >= 16
        && pc.getHighCardPoints() <= 18 && pc.isBalanced();
  }

}
TOP

Related Classes of org.gnubridge.core.bidding.rules.Open1NT

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.