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); }
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(); } }
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; }
private bool NeedToMakeAITurn() { return(CurrentPlayer.IsAI && CurrentHand.IsPlayerInvolved(CurrentPlayer) && !CurrentPlayer.IsAllIn); }