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

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

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