コード例 #1
0
  @Test
  public void testFirstPlayerToActTwoCards1() {
    TelesinaPlayerToActCalculator ptac = new TelesinaPlayerToActCalculator(Rank.SEVEN);
    SortedMap<Integer, PokerPlayer> seating = new TreeMap<Integer, PokerPlayer>();

    PokerPlayer p1 = playerWithHand(1, "7C", "7D");
    PokerPlayer p2 = playerWithHand(2, "AS", "KS");

    seating.put(1, p1);
    seating.put(2, p2);

    PokerPlayer first = ptac.getFirstPlayerToAct(seating, Collections.EMPTY_LIST);
    assertEquals(2, first.getId());
  }
コード例 #2
0
  @Test
  public void testFirstPlayerToActVelaRound1() {
    TelesinaPlayerToActCalculator ptac = new TelesinaPlayerToActCalculator(Rank.SEVEN);

    SortedMap<Integer, PokerPlayer> seating = new TreeMap<Integer, PokerPlayer>();

    PokerPlayer p1 = playerWithHand(1, "AH", "KH QH JH TH");
    PokerPlayer p2 = playerWithHand(2, "7D", "8C TD JS QD");
    PokerPlayer p3 = playerWithHand(3, "QH", "7S TD 9S 7C");

    seating.put(1, p1);
    seating.put(2, p2);
    seating.put(3, p3);

    PokerPlayer first = ptac.getFirstPlayerToAct(seating, Arrays.asList(new Card("9H")));
    assertEquals(1, first.getId());
  }
コード例 #3
0
  @Test
  public void testFirstPlayerToActThreeCards5() {
    TelesinaPlayerToActCalculator ptac = new TelesinaPlayerToActCalculator(Rank.SEVEN);

    SortedMap<Integer, PokerPlayer> seating = new TreeMap<Integer, PokerPlayer>();

    PokerPlayer p1 = playerWithHand(1, "AH", "KH QH JH TH");
    PokerPlayer p2 = playerWithHand(2, "7D", "8C 9H TD JS");
    PokerPlayer p3 = playerWithHand(3, "QH", "7S 9C TD 9S");

    seating.put(1, p1);
    seating.put(2, p2);
    seating.put(3, p3);

    PokerPlayer first = ptac.getFirstPlayerToAct(seating, Collections.EMPTY_LIST);
    assertEquals(3, first.getId());
  }
コード例 #4
0
  @Test
  public void testFirstPlayerToActTwoCards2() {
    TelesinaPlayerToActCalculator ptac = new TelesinaPlayerToActCalculator(Rank.SEVEN);

    SortedMap<Integer, PokerPlayer> seating = new TreeMap<Integer, PokerPlayer>();

    PokerPlayer p1 = playerWithHand(1, "7C", "7D");
    PokerPlayer p2 = playerWithHand(2, "8C", "KS");
    PokerPlayer p3 = playerWithHand(3, "9C", "KH");
    PokerPlayer p4 = playerWithHand(4, "TC", "QD");
    PokerPlayer p5 = playerWithHand(5, "JC", "9S");
    PokerPlayer p6 = playerWithHand(6, "QC", "QS");

    seating.put(1, p1);
    seating.put(2, p2);
    seating.put(3, p3);
    seating.put(4, p4);
    seating.put(5, p5);
    seating.put(6, p6);

    PokerPlayer first = ptac.getFirstPlayerToAct(seating, Collections.EMPTY_LIST);
    assertEquals(3, first.getId());
  }