Example #1
0
        public void MoveToReleasedDeck(Player player, ReleasedDeck releasedDeck, int cardValue, Card card)
        {
            Card cardToRemoveFromPlayer = null;

            player.RemoveFromDisplayingCard(card);
            releasedDeck.ReceiveDisplayingCard(card);
            cardToRemoveFromPlayer = card;
            AddCardAnimation(card, releasedDeck.position);

            cardToRemoveFromPlayer = null;
            player.RepositionDisplayingCards(this);


            /*
             *          int start = DisplayingCards.Count - 1;
             *          int finish = DisplayingCards.Count - 1 - numberOfCard;
             *
             *          List<Card> cardsToRemoveFromDeck = new List<Card>();
             *
             *          for (int i = start; i > finish; i--)
             *          {
             *              Card card = DisplayingCards[i];
             *              releasedDeck.ReceiveDisplayingCard(card);
             *              cardsToRemoveFromDeck.Add(card);
             *              AddCardAnimation(card, releasedDeck.position);
             *          }
             *
             *          foreach (Card card in cardsToRemoveFromDeck)
             *          {
             *              DisplayingCards.Remove(card);
             *          }*/
        }
Example #2
0
        public void DealToReleasedDeck(ReleasedDeck releasedDeck, int numberOfCard)
        {
            int start  = DisplayingCards.Count - 1;
            int finish = DisplayingCards.Count - 1 - numberOfCard;

            List <Card> cardsToRemoveFromDeck = new List <Card>();

            for (int i = start; i > finish; i--)
            {
                Card card = DisplayingCards[i];
                releasedDeck.ReceiveDisplayingCard(card);
                cardsToRemoveFromDeck.Add(card);
                AddCardAnimation(card, releasedDeck.position);
            }

            foreach (Card card in cardsToRemoveFromDeck)
            {
                DisplayingCards.Remove(card);
            }
        }