Beispiel #1
0
    public string GetCardPrefabNameByType(Constants.CardType type)
    {
        string result = "";

        switch (type)
        {
        case Constants.CardType.Soul:
            result = GlobalSettings._globalSettings.creatureCard.name;
            break;

        case Constants.CardType.Spell:

            result = GlobalSettings._globalSettings.spellCard.name;
            break;

        case Constants.CardType.Player:
            result = GlobalSettings._globalSettings.playerCard.name;

            break;

        case Constants.CardType.Support:
            result = GlobalSettings._globalSettings.supportCard.name;

            break;
        }

        return(result);
    }
Beispiel #2
0
    public static List <CardVisual> FindAllCardsOfType(CardType type, DeckType zone = DeckType.None)
    {
        List <CardVisual> cardsToSearch = new List <CardVisual>();

        if (zone == DeckType.None)
        {
            cardsToSearch = Deck._allCards.activeCards;
        }
        else
        {
            cardsToSearch = FindAllCardsInZone(zone);
        }

        List <CardVisual> sortedcards = new List <CardVisual>();

        for (int i = 0; i < cardsToSearch.Count; i++)
        {
            if (cardsToSearch[i].primaryCardType == type)
            {
                sortedcards.Add(cardsToSearch[i]);
            }
        }

        return(sortedcards);
    }
Beispiel #3
0
    public static List <CardVisual> FindAllCardsOfType(CardType type, DeckType zone, OwnerConstraints ownerConstraints)
    {
        List <CardVisual> cards = FindAllCardsOfType(type, zone);

        List <CardVisual> sortedcards = SortCardsByOwner(cards, ownerConstraints);

        return(sortedcards);
    }
Beispiel #4
0
    public CardVisual SpawnCopy(CardVisual target)
    {
        spawnCardType = target.primaryCardType;
        CardData   tokenData = Resources.Load <CardData>("CardData/" + target.cardData.name) as CardData;
        CardVisual tokenCard = SpawnBaseToken(tokenData, GetCardPrefabName(spawnCardType));

        //Debug.Log(tokenCard.cardData.cardName + " is being copied");

        return(tokenCard);
    }
Beispiel #5
0
 public static bool CardHasPrimaryType(CardVisual card, CardType type)
 {
     return(card.primaryCardType == type);
 }
Beispiel #6
0
    public static List <CardVisual> FindAllCardsInZone(DeckType zone, Keywords keyWord, OwnerConstraints ownerConstraints, CardType cardType)
    {
        List <CardVisual> cards = FindAllCardsInZone(zone, keyWord, ownerConstraints);

        List <CardVisual> sortedCards = FindAllCardsOfType(cards, cardType);

        return(sortedCards);
    }
Beispiel #7
0
    public static List <CardVisual> FindAllCardsOfType(List <CardVisual> cardsToSearch, CardType type)
    {
        List <CardVisual> results = new List <CardVisual>();

        for (int i = 0; i < cardsToSearch.Count; i++)
        {
            if (cardsToSearch[i].primaryCardType == type)
            {
                results.Add(cardsToSearch[i]);
            }
        }

        return(results);
    }
Beispiel #8
0
 protected string GetCardPrefabName(Constants.CardType cardType)
 {
     return(Deck._allCards.GetCardPrefabNameByType(cardType));
 }