Ejemplo n.º 1
0
  /**
   * Reveals player hands, awards payouts, then advances to hand end phase.
   *
   * @param reveal If remaining hands should be revealed
   */
  public void showdown(boolean reveal) {
    // Ensure table has 5 cards
    dealTableCards(5 - tableCards.size());

    if (reveal) {
      // Remaining players reveal hands
      revealHands();
    }

    // Compare hands and award payouts
    Map<PokerPlayer, Double> payouts = new HashMap<>();
    pot.calculatePayouts(payouts);
    awardPayouts(payouts);
    pot = null;

    handEnd();
  }