コード例 #1
0
        public void GainCardFromSupply(Card typeToGain, IActionScope turnScope)
        {
            Card gainedCard = turnScope.Supply.AcquireCard(typeToGain, turnScope);

            turnScope.Publish(new PlayerGainedCardEvent(gainedCard, turnScope));
            DiscardPile.Discard(gainedCard, turnScope);
        }
コード例 #2
0
        public void EndGameCleanup(Game game)
        {
            var scope = game.StartTurn(this);

            Hand.Discard(DiscardPile, scope);
            DiscardPile.Into(Deck, scope);
        }
コード例 #3
0
        public void ShuffleDiscardPileIntoDeck(IActionScope turnScope)
        {
            DiscardPile.Into(Deck, turnScope);
            Deck = Deck.Shuffle();

            turnScope.Publish(new DeckReplenishedEvent(turnScope));
        }
コード例 #4
0
ファイル: Hand.cs プロジェクト: thatpaulschofield/Dominion
 public void Discard(Card card, DiscardPile discardPile, IActionScope scope)
 {
     if (this.Contains(card))
     {
         InnerList.Remove(card);
         discardPile.Discard(card, scope);
     }
 }
コード例 #5
0
 private void ReshuffleDrawDeck()
 {
     if (DiscardPile.Count > 0)
     {
         DrawDeck.AddRange(DiscardPile.Shuffle());
         DiscardPile.Clear();
     }
 }
コード例 #6
0
 public void moveCardFromGlobalPilesToPlayerDiscardPile(string cardName)
 {
     if (!gameBoard.globalCardsPiles.getCardsPile(cardName).isEmpty())
     {
         addCardToPlayerDiscardPile(gameBoard.globalCardsPiles.getCardsPile(cardName).drawCard());
         DiscardPile.Peek().CardOwner = cardsPilesOwner;
     }
 }
コード例 #7
0
        public Player(Deck deck, DiscardPile discardPile, IPlayerController strategy, PlayerId id = null, string name = "Player")
        {
            _controller = strategy;
            Name        = name;

            if (deck == null)
            {
                throw new ArgumentNullException("Must pass non-null instance of Deck");
            }

            Hand        = new Hand();
            DiscardPile = discardPile;
            Deck        = deck.Shuffle();
        }
コード例 #8
0
ファイル: Hand.cs プロジェクト: thatpaulschofield/Dominion
 public void Discard(DiscardPile discardPile, IActionScope turnScope)
 {
     InnerList.ToList().ForEach(c => Discard(c, discardPile, turnScope));
 }
コード例 #9
0
 public void DiscardCardsInHand()
 {
     DiscardPile.AddRange(Hand);
     Hand.Clear();
 }
コード例 #10
0
 private void DiscardCardsInPlay()
 {
     DiscardPile.AddRange(InPlay);
     InPlay.Clear();
 }
コード例 #11
0
 public void PlaceCardsInDiscardPile(CardSet cards)
 {
     DiscardPile.AddRange(cards);
 }