RemoveCardFromHand() 개인적인 메소드

private RemoveCardFromHand ( Dominion.Card cardType ) : Dominion.Card
cardType Dominion.Card
리턴 Dominion.Card
예제 #1
0
        internal void DoPlayTreasures(PlayerState currentPlayer)
        {
            currentPlayer.playPhase = PlayPhase.PlayTreasure;
            while (true)
            {
                Card cardTypeToPlay = currentPlayer.actions.GetTreasureFromHandToPlay(this, acceptableCard => true, isOptional:true);
                if (cardTypeToPlay == null)
                {
                    break;
                }

                Card currentCard = currentPlayer.RemoveCardFromHand(cardTypeToPlay);
                if (currentCard == null)
                {
                    throw new Exception("Player tried to remove a card that wasn't available in hand");
                }

                currentPlayer.DoPlayTreasure(currentCard, this);
            }
        }
예제 #2
0
        internal Card DoPlayOneTreasure(PlayerState currentPlayer)
        {
            Card cardTypeToPlay = currentPlayer.actions.GetTreasureFromHandToPlay(this, acceptableCard => true, isOptional: true);
            if (cardTypeToPlay == null)
            {
                return null;
            }

            Card currentCard = currentPlayer.RemoveCardFromHand(cardTypeToPlay);
            if (currentCard == null)
            {
                throw new Exception("Player tried to remove a card that wasn't available in hand");
            }

            currentPlayer.DoPlayTreasure(currentCard, this);

            return cardTypeToPlay;
        }