Package org.gnubridge.core

Examples of org.gnubridge.core.Deal.playOneTrick()


public class TestPositionLookup extends TestCase {
  public void testSameObjectShownTwice() {
    Deal g = new Deal(NoTrump.i());
    GameUtils.initializeSingleColorSuits(g);
    g.playOneTrick();

    PositionLookup pl = new PositionLookup();
    Node node = new Node(null);
    assertFalse(pl.positionEncountered(g, node.getTricksTaken()));
    assertTrue(pl.positionEncountered(g, node.getTricksTaken()));
View Full Code Here


  @SuppressWarnings("unused")
  public void testOnlyReturnFirstNodeEncountetredForThePosition() {
    Deal g = new Deal(NoTrump.i());
    GameUtils.initializeSingleColorSuits(g);
    g.playOneTrick();

    PositionLookup pl = new PositionLookup();
    Node node = new Node(null);
    boolean justPresentThePosition = pl.positionEncountered(g, node.getTricksTaken());
View Full Code Here

    Node node = new Node(null);
    boolean justPresentThePosition = pl.positionEncountered(g, node.getTricksTaken());

    Deal identicalTwin = new Deal(NoTrump.i());
    GameUtils.initializeSingleColorSuits(identicalTwin);
    identicalTwin.playOneTrick();

    Node identicalTwinNode = new Node(null);
    assertTrue(pl.positionEncountered(identicalTwin, identicalTwinNode.getTricksTaken()));
    assertEquals(node.getTricksTaken(), pl.getNode(identicalTwin));
View Full Code Here

  @SuppressWarnings("unused")
  public void testDistinguishDifferentPlays() {
    Deal g = new Deal(NoTrump.i());
    GameUtils.initializeSingleColorSuits(g);
    g.playOneTrick();

    PositionLookup pl = new PositionLookup();
    boolean justPresentThePosition = pl.positionEncountered(g, null);

    Deal g2 = new Deal(NoTrump.i());
View Full Code Here

  @SuppressWarnings("unused")
  public void testOneCardPlayedDifferentObjectsSamePosition() {
    Deal g = new Deal(NoTrump.i());
    GameUtils.initializeSingleColorSuits(g);
    g.playOneTrick();

    PositionLookup pl = new PositionLookup();
    Node node = new Node(null);
    boolean justPresentThePosition = pl.positionEncountered(g, node.getTricksTaken());
View Full Code Here

    Node node = new Node(null);
    boolean justPresentThePosition = pl.positionEncountered(g, node.getTricksTaken());

    Deal g2 = new Deal(NoTrump.i());
    GameUtils.initializeSingleColorSuits(g2);
    g2.playOneTrick();
    assertTrue(pl.positionEncountered(g2, null));
    assertEquals(node.getTricksTaken(), pl.getNode(g2));
  }

  public void testOneCardPlayedDifferentCards() {
View Full Code Here

  @SuppressWarnings("unused")
  public void testCanRememberMoreThanOnePosition() {
    Deal g = new Deal(NoTrump.i());
    GameUtils.initializeSingleColorSuits(g);
    g.playOneTrick();

    PositionLookup pl = new PositionLookup();

    Deal gameWithDifferentCardPlayed = new Deal(NoTrump.i());
    GameUtils.initializeSingleColorSuits(gameWithDifferentCardPlayed);
View Full Code Here

  @SuppressWarnings("unused")
  public void testTwoTricksPlayedSameFirstTrick() {
    Deal g = new Deal(NoTrump.i());
    GameUtils.initializeSingleColorSuits(g);
    g.playOneTrick();
    g.playOneTrick();

    Deal sameFirstTrick = new Deal(NoTrump.i());
    GameUtils.initializeSingleColorSuits(sameFirstTrick);
    sameFirstTrick.playOneTrick();
View Full Code Here

  @SuppressWarnings("unused")
  public void testTwoTricksPlayedSameFirstTrick() {
    Deal g = new Deal(NoTrump.i());
    GameUtils.initializeSingleColorSuits(g);
    g.playOneTrick();
    g.playOneTrick();

    Deal sameFirstTrick = new Deal(NoTrump.i());
    GameUtils.initializeSingleColorSuits(sameFirstTrick);
    sameFirstTrick.playOneTrick();
    playOneTrickWithSlightTwist(sameFirstTrick);
View Full Code Here

    g.playOneTrick();
    g.playOneTrick();

    Deal sameFirstTrick = new Deal(NoTrump.i());
    GameUtils.initializeSingleColorSuits(sameFirstTrick);
    sameFirstTrick.playOneTrick();
    playOneTrickWithSlightTwist(sameFirstTrick);

    PositionLookup pl = new PositionLookup();
    boolean justPresentThePosition = pl.positionEncountered(g, null);
View Full Code Here

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.