Dominion.PlayerState.RequestPlayerSpendCoinTokensBeforeBuyPhase C# (CSharp) Method

RequestPlayerSpendCoinTokensBeforeBuyPhase() private method

private RequestPlayerSpendCoinTokensBeforeBuyPhase ( GameState gameState ) : void
gameState GameState
return void
        internal void RequestPlayerSpendCoinTokensBeforeBuyPhase(GameState gameState)
        {
            this.EnterPhase(PlayPhase.SpendCoinTokens);
            int coinToSpend = this.actions.GetCoinAmountToSpendInBuyPhase(gameState);
            if (coinToSpend > this.AvailableCoinTokens || coinToSpend < 0)
                throw new Exception("Can not spend that many coins");
            if (coinToSpend != 0)
            {
                this.AddCoinTokens(-coinToSpend);
                this.gameLog.PushScope();
                this.AddCoins(coinToSpend);
                this.gameLog.PopScope();
            }
        }

Usage Example

Example #1
0
        public void PlayTurn(PlayerState currentPlayer)
        {
            System.Threading.Interlocked.Increment(ref turnTotalCount);
            currentPlayer.numberOfTurnsPlayed += 1;
            IPlayerAction currentPlayerAction = currentPlayer.actions;

            this.gameLog.BeginTurn(currentPlayer);
            this.gameLog.PushScope();
            currentPlayer.InitializeTurn();

            ReturnCardsToHandAtStartOfTurn(currentPlayer);
            DoActionsQueuedFromPreviousTurn(currentPlayer);
            DoDurationActionsFromPreviousTurn(currentPlayer);
            DoActionPhase(currentPlayer);
            DoPlayTreasures(currentPlayer);
            currentPlayer.RequestPlayerSpendCoinTokensBeforeBuyPhase(this);
            DoBuyPhase(currentPlayer);
            DoCleanupPhase(currentPlayer);

            int cardCountForNextTurn = this.doesCurrentPlayerNeedOutpostTurn ? 3 : 5;
            currentPlayer.DrawUntilCountInHand(cardCountForNextTurn);
            currentPlayer.playPhase = PlayPhase.NotMyTurn;

            this.gameLog.EndTurn(currentPlayer);
            this.gameLog.PopScope();
        }
All Usage Examples Of Dominion.PlayerState::RequestPlayerSpendCoinTokensBeforeBuyPhase
PlayerState