コード例 #1
0
ファイル: Dealer.cs プロジェクト: TheDizzler/Dragons
 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();
     }
 }
コード例 #2
0
ファイル: Dealer.cs プロジェクト: TheDizzler/Dragons
        public void Fold(PokerPlayer currentPlayer)
        {
            EndPlayerTurn();
            currentPlayer.Fold();
            activePlayers.Remove(currentPlayer);
            if (activePlayers.Count == 1)
            {
                ShowDown();
                return;
            }

            if (--currentPlayerIndex < 0)
            {
                currentPlayerIndex = 0;
            }
            StartCoroutine(PrepNextPlayerTurn());
        }
コード例 #3
0
ファイル: Dealer.cs プロジェクト: TheDizzler/Dragons
        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;
            }
        }
コード例 #4
0
 public void SetOwner(PokerPlayer player)
 {
     owner = player;
 }
コード例 #5
0
 public HandRank(PokerPlayer player, List <Card> hand)
 {
     this.hand = hand;
     hand.Sort();
     GetBestHand();
 }
コード例 #6
0
ファイル: Dealer.cs プロジェクト: TheDizzler/Dragons
 private void Winner(PokerPlayer player)
 {
     player.AddFunds(pot.GetWinnings());
 }