private void StartDrawPhase() { pot.DisplayRaiseAmount(totalRaiseAmount); if (++drawPhaseCount >= pokerRules.MaxDrawsAllowed) { // no more draws. Call game. ShowDown(); } else { phase = PokerRules.TurnPhase.Draw; currentPlayerIndex = 0; firstPlayerToDrawCards = null; StartPlayerTurn(); } }
public void Fold(PokerPlayer currentPlayer) { EndPlayerTurn(); currentPlayer.Fold(); activePlayers.Remove(currentPlayer); if (activePlayers.Count == 1) { ShowDown(); return; } if (--currentPlayerIndex < 0) { currentPlayerIndex = 0; } StartCoroutine(PrepNextPlayerTurn()); }
private void StartPlayerTurn() { playerNameText.text = activePlayers[currentPlayerIndex].name; switch (phase) { case PokerRules.TurnPhase.Draw: if (firstPlayerToDrawCards == null) { firstPlayerToDrawCards = activePlayers[currentPlayerIndex]; } else if (firstPlayerToDrawCards == activePlayers[currentPlayerIndex]) { EndPlayerTurn(); StartBetPhase(); break; } drawButton.SetActive(true); activePlayers[currentPlayerIndex].StartDraw(); break; case PokerRules.TurnPhase.Bet: if (lastRaiser == null) { // this is the first bet lastRaiser = activePlayers[currentPlayerIndex]; } else if (lastRaiser == activePlayers[currentPlayerIndex]) { // betting phase is done EndPlayerTurn(); StartDrawPhase(); break; } int amtMatched = amountMatchedThisRound[activePlayers[currentPlayerIndex]]; activePlayers[currentPlayerIndex].StartBetting(betting, totalRaiseAmount - amtMatched); break; } }
public void SetOwner(PokerPlayer player) { owner = player; }
public HandRank(PokerPlayer player, List <Card> hand) { this.hand = hand; hand.Sort(); GetBestHand(); }
private void Winner(PokerPlayer player) { player.AddFunds(pot.GetWinnings()); }