Example #1
0
        /// <summary>
        /// Move a card out of the Discard Pile
        /// </summary>
        /// <param name="played">Card: the card on the top of the Discard Pile</param>
        private static void MoveDiscardPile(Card played)
        {
            CardPile saved   = discardPile;
            bool     removed = false;

            while (!removed)
            {
                discardPile.RemoveLastCard();
                if (discardPile.ContainsCard(played))
                {
                    discardPile = saved;
                }
                else
                {
                    removed = true;
                }
            }
        }