Exemple #1
0
        public void TakeSingleCardFromDeck(Deck deck)
        {
            try
            {
                cards.Add(deck.TakeTopCard());
            }
            catch (InvalidOperationException)
            {
                throw new PlayerTakingCardsException(deck, this, 1);
            }

            // ActiveInCurrentTurn = true;

            CardsTaken?.Invoke(this, new CardsTakenEventArgs(1));
        }
Exemple #2
0
        public virtual void TakeCardsFromDeck(Deck deck, int numOfCards)
        {
            try
            {
                Card[] newCards = deck.TakeCardsFromTop(numOfCards);
                cards.AddRange(newCards.Reverse());
            }
            catch (ArgumentException)
            {
                throw new PlayerTakingCardsException(deck, this, numOfCards);
            }

            //ActiveInCurrentTurn = true;

            CardsTaken?.Invoke(this, new CardsTakenEventArgs(numOfCards));
        }