Ejemplo n.º 1
0
        private void BeginShowdown()
        {
            // TODO: add muck possibility
            CurrentHandState.Instance.SetState(HandState.Showdown);

            List <int> playerIndexes = new List <int>();

            for (int playerIndex = 0; playerIndex < _playerCount; playerIndex++)
            {
                Player player = _players[playerIndex];
                if (CurrentHand.IsPlayerInvolved(player) && !player.IsLocal)
                {
                    playerIndexes.Add(playerIndex);
                }
            }

            GameController.Instance.ProcessShowdown(playerIndexes);
        }
Ejemplo n.º 2
0
        public virtual void PlayTurn()
        {
            Debug.Log("Game PlayTurn");
            //_currentPlayerIndex++;

            //if (_currentPlayerIndex >= _playerCount) {
            //    _currentPlayerIndex = 0;
            //}

            //// TODO: check if this causes some issues
            //if (!CurrentHand.IsPlayerInvolved(CurrentPlayer) || CurrentPlayer.IsAllIn) {
            //    PlayTurn();
            //}
            IncrementPlayerIndex();
            while (!CurrentHand.IsPlayerInvolved(CurrentPlayer) || CurrentPlayer.IsAllIn)
            {
                IncrementPlayerIndex();
            }
        }
Ejemplo n.º 3
0
        private void SetPlayerFirstToAct()
        {
            int playerFirstToActIndex = CurrentHandState.Instance.IsPreflop ? GetPlayerOnTheBigBlindIndex() + 1 : GetPlayerOnTheButtonIndex() + 1;

            if (playerFirstToActIndex >= _playerCount)
            {
                playerFirstToActIndex = 0;
            }
            Player playerFirstToAct = _players[playerFirstToActIndex];

            while (!CurrentHand.IsPlayerInvolved(playerFirstToAct))
            {
                playerFirstToActIndex++;
                if (playerFirstToActIndex >= _playerCount)
                {
                    playerFirstToActIndex = 0;
                }
                playerFirstToAct = _players[playerFirstToActIndex];
            }

            _currentPlayerIndex = playerFirstToActIndex;
        }
Ejemplo n.º 4
0
 private bool NeedToMakeAITurn()
 {
     return(CurrentPlayer.IsAI &&
            CurrentHand.IsPlayerInvolved(CurrentPlayer) &&
            !CurrentPlayer.IsAllIn);
 }