DoPlayTreasure() private method

private DoPlayTreasure ( Dominion.Card currentCard, GameState gameState ) : void
currentCard Dominion.Card
gameState GameState
return void
コード例 #1
0
        public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState)
        {
            Card cardToPlay = null;
            while (true)
            {
                Card revealedCard = currentPlayer.DrawAndRevealOneCardFromDeck(gameState);
                if (revealedCard == null)
                {
                    break;
                }
                if (revealedCard.isTreasure)
                {
                    cardToPlay = currentPlayer.cardsBeingRevealed.RemoveCard(revealedCard);
                    break;
                }
            }
            currentPlayer.MoveRevealedCardsToDiscard(gameState);

            if (cardToPlay != null)
            {
                currentPlayer.DoPlayTreasure(cardToPlay, gameState);
            }
        }
コード例 #2
0
ファイル: GameState.cs プロジェクト: peterhal/Dominulator
        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);
            }
        }
コード例 #3
0
ファイル: DarkAges.cs プロジェクト: peterhal/Dominulator
 public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState)
 {
     Card cardToPlay = currentPlayer.RequestPlayerChooseCardToRemoveFromHandForPlay(gameState, Delegates.IsTreasureCardPredicate, isTreasure: true, isAction: false, isOptional: true);
     if (cardToPlay != null)
     {
         currentPlayer.DoPlayTreasure(cardToPlay, gameState);
         currentPlayer.DoPlayTreasure(cardToPlay, gameState);
         currentPlayer.MoveCardFromPlayToTrash(gameState);
     }
 }
コード例 #4
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;
        }