Dominion.PlayerState.DrawUntilCountInHand C# (CSharp) Method

DrawUntilCountInHand() private method

private DrawUntilCountInHand ( int totalCount, GameState gameState ) : void
totalCount int
gameState GameState
return void
        internal void DrawUntilCountInHand(int totalCount, GameState gameState)
        {
            while (hand.Count < totalCount)
            {
                if (!DrawOneCardIntoHand(gameState))
                {
                    return;
                }
            }
        }

Usage Example

Example #1
0
        public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState)
        {
            currentPlayer.GainCardFromSupply(Silver.card, gameState);

            // look at the top card of the deck and discard or put it back
            Card card = currentPlayer.DrawAndLookAtOneCardFromDeck();
            if (card != null)
            {
                if (currentPlayer.actions.ShouldPlayerDiscardCardFromDeck(gameState, currentPlayer, card))
                {
                    currentPlayer.gameLog.PushScope();
                    currentPlayer.MoveLookedAtCardsToDiscard(gameState);
                    currentPlayer.gameLog.PlayerDiscardCard(currentPlayer, card);
                    currentPlayer.gameLog.PopScope();
                }
                else
                {
                    currentPlayer.MoveLookedAtCardToTopOfDeck(card);
                }
            }

            currentPlayer.DrawUntilCountInHand(5);

            currentPlayer.RequestPlayerTrashCardFromHand(gameState, acceptableCard => !acceptableCard.isTreasure, isOptional: true);
        }
All Usage Examples Of Dominion.PlayerState::DrawUntilCountInHand
PlayerState