예제 #1
0
    public void TransferCard(AbilityCard card, AbilityDeck destination)
    {
        if (destination.IsDeckFull())
        {
            Debug.Log("Target Deck is Full");
            return;
        }

        //Debug.Log("transfering a card from " + card.currentDeck.deckType + " to " + destination.deckType);

        card.previousDeck = this;
        card.currentDeck  = destination;

        RemoveCard(card);
        destination.Addcard(card);
    }
    private void TransferCardSet(List <AbilityCard> cards, AbilityDeck destination)
    {
        int count = cards.Count;

        for (int i = 0; i < count; i++)
        {
            if (cards[i].currentDeck == null)
            {
                destination.Addcard(cards[i]);
                //Debug.Log(cards[i] + " had no current deck. Assigning: " + destination.deckType);
            }
            else
            {
                //Debug.Log(cards[i] + " is being transfered to " + destination.deckType);
                cards[i].currentDeck.TransferCard(cards[i], destination);
            }
        }
    }