Esempio n. 1
0
 private bool CanClearItem(CardCacheItem item, CollectionDeck currentlyOpenDeck, List <string> deckHelperCardChoices)
 {
     if ((currentlyOpenDeck != null) && (currentlyOpenDeck.GetCardIdCount(item.m_cardId) > 0))
     {
         return(false);
     }
     if ((deckHelperCardChoices != null) && deckHelperCardChoices.Contains(item.m_cardId))
     {
         return(false);
     }
     return(true);
 }
    public static CollectionDeckViolationCardIdOverflow GetDeckViolationCardIdOverflow(CollectionDeck deck, string cardID, bool useExtraCopyOfCard)
    {
        CollectionDeckViolationCardIdOverflow overflow = null;
        CollectionDeckViolationCardIdOverflow overflow2;
        int cardIdCount = deck.GetCardIdCount(cardID);

        if (useExtraCopyOfCard)
        {
            cardIdCount++;
        }
        if (DefLoader.Get().GetEntityDef(cardID).IsElite())
        {
            if (cardIdCount > 1)
            {
                overflow2 = new CollectionDeckViolationCardIdOverflow {
                    DeckID        = deck.ID,
                    ViolationType = CollectionDeckViolationType.ELITE_CARD_ID_OVERFLOW,
                    CardID        = cardID,
                    Count         = cardIdCount
                };
                overflow = overflow2;
            }
            return(overflow);
        }
        if (cardIdCount > 2)
        {
            overflow2 = new CollectionDeckViolationCardIdOverflow {
                DeckID        = deck.ID,
                ViolationType = CollectionDeckViolationType.CARD_ID_OVERFLOW,
                CardID        = cardID,
                Count         = cardIdCount
            };
            overflow = overflow2;
        }
        return(overflow);
    }