Example #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);
        }
Example #2
0
        public void EndGameCleanup(Game game)
        {
            var scope = game.StartTurn(this);

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

            turnScope.Publish(new DeckReplenishedEvent(turnScope));
        }
Example #4
0
 public void Discard(Card card, DiscardPile discardPile, IActionScope scope)
 {
     if (this.Contains(card))
     {
         InnerList.Remove(card);
         discardPile.Discard(card, scope);
     }
 }
Example #5
0
 private void ReshuffleDrawDeck()
 {
     if (DiscardPile.Count > 0)
     {
         DrawDeck.AddRange(DiscardPile.Shuffle());
         DiscardPile.Clear();
     }
 }
Example #6
0
 public void moveCardFromGlobalPilesToPlayerDiscardPile(string cardName)
 {
     if (!gameBoard.globalCardsPiles.getCardsPile(cardName).isEmpty())
     {
         addCardToPlayerDiscardPile(gameBoard.globalCardsPiles.getCardsPile(cardName).drawCard());
         DiscardPile.Peek().CardOwner = cardsPilesOwner;
     }
 }
Example #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();
        }
Example #8
0
 public void Discard(DiscardPile discardPile, IActionScope turnScope)
 {
     InnerList.ToList().ForEach(c => Discard(c, discardPile, turnScope));
 }
Example #9
0
 public void DiscardCardsInHand()
 {
     DiscardPile.AddRange(Hand);
     Hand.Clear();
 }
Example #10
0
 private void DiscardCardsInPlay()
 {
     DiscardPile.AddRange(InPlay);
     InPlay.Clear();
 }
Example #11
0
 public void PlaceCardsInDiscardPile(CardSet cards)
 {
     DiscardPile.AddRange(cards);
 }