Exemplo n.º 1
0
  @Override
  public void start() {
    // Close table
    setOpen(false);

    // Begin first phase
    phase = PokerPhase.PREFLOP;

    // Create pot
    pot = newPot(0, new HashSet<>(getPlayers()));

    // Post blinds
    blinds();

    // Deal 2 cards to each player
    deck.shuffle();
    for (PokerPlayer player : getPlayers()) {
      player.dealCard(deck.draw(player), deck.draw(player));
    }

    // Start betting with player left of big blind
    playerTurn = getPlayerCount() - 2;
    nextPlayer();
    for (PokerPlayer player : getPlayers()) {
      player.requireAction();
    }
    betting();
  }
Exemplo n.º 2
0
  /**
   * Deals cards to the table's community cards and continues betting.
   *
   * @param cards The amount of cards to deal
   */
  public void bettingRound(int cards) {
    // Deal cards to the table
    dealTableCards(cards);

    // Start betting with player left of dealer (small blind)
    playerTurn = getPlayerCount() - 1;
    for (PokerPlayer player : getPlayers()) {
      player.requireAction();
    }
    betting();
  }