Package org.gnubridge.core.bidding

Examples of org.gnubridge.core.bidding.ScoreCalculator


    MainController mainController = makeController();
    mainController.getBiddingController().placeBid(7, "Clubs");
    mainController.playGame();
    playGameToTheEnd(mainController);
    Thread.sleep(300);
    int score = new ScoreCalculator(mainController.getBiddingController().getAuction().getHighBid(), mainController
        .getGameController().getGame().getTricksTaken(Player.NORTH_SOUTH), new Vulnerability(false, false))
        .getDeclarerScore();
    System.out.println("Game finished. Declarers took "
        + mainController.getGameController().getGame().getTricksTaken(Player.NORTH_SOUTH) + " tricks. Score: "
        + score);

    assertTrue(1000 + 20 * 7 == score || 1500 + 20 * 7 == score);

    System.out.println("Running Human Score: " + mainController.getRunningHumanScore());
    System.out.println("Running Computer Score: " + mainController.getRunningComputerScore());
    assertEquals(0, mainController.getRunningComputerScore());

    preInitializeGame13Tricks();
    mainController.getGameController().newGame();
    mainController.getBiddingController().placeBid(7, "Spades");

    Thread.sleep(300);

    mainController.playGame();
    playGameToTheEnd(mainController);
    score = new ScoreCalculator(mainController.getBiddingController().getAuction().getHighBid(), mainController
        .getGameController().getGame().getTricksTaken(Player.NORTH_SOUTH), new Vulnerability(false, false))
        .getDefenderScore();

    System.out.println("Running Human Score: " + mainController.getRunningHumanScore());
    System.out.println("Running Computer Score: " + mainController.getRunningComputerScore());
View Full Code Here


  }

  public void processFinishedGame(int directionOfHuman, Bid highBid, int declarerTricksTaken) {
    this.directionOfHuman = directionOfHuman;

    ScoreCalculator calculator = new ScoreCalculator(highBid, declarerTricksTaken, usThemVulnerability
        .asDeclarerDefender(directionOfHuman));

    latestDeclarerScoreChange = calculator.getDeclarerScore();
    latestDefenderScoreChange = calculator.getDefenderScore();

    if (isHumanDeclarer()) {
      runningHumanScore += latestDeclarerScoreChange;
      runningComputerScore += latestDefenderScoreChange;
    } else {
View Full Code Here

TOP

Related Classes of org.gnubridge.core.bidding.ScoreCalculator

Copyright © 2018 www.massapicom. 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.