Exemple #1
0
        private bool CheckType(ICardAllDbInfo cai)
        {
            if (ExcludeSpecialCards)
            {
                if (MultiPartCardManager.Instance.IsSpecial(cai))
                {
                    return(false);
                }
            }

            if (TypesSelected.Count == 0)
            {
                return(true);
            }

            CardType type = MultiPartCardManager.Instance.GetCardType(cai);

            CardType wantedType = TypesSelected.Aggregate(CardType.Token, (current, newtype) => current | newtype);

            if (TypeAggregation == MultiSelectedAggregation.And)
            {
                return(Matcher <CardType> .IncludeValue(type, wantedType));
            }
            //TypeAggregation == MultiSelectedAggregation.Or
            return(Matcher <CardType> .HasValue(type, wantedType));
        }
Exemple #2
0
        private bool CheckType(CardCollectionInputGraphicViewModel vm)
        {
            if (TypesSelected.Count == 0)
            {
                return(true);
            }

            CardType type       = vm.GetCardType();
            CardType wantedType = TypesSelected.Aggregate(CardType.Token, (current, newType) => current | newType);

            return(Matcher <CardType> .HasValue(type, wantedType));
        }