/// <summary> /// Determines if the specified dictionary entry passes the filter. /// </summary> /// <param name="entry">The entry to test.</param> /// <param name="exclusive">Specifies whether the search is exclusive.</param> /// <returns></returns> public bool Test(RantDictionaryEntry entry, bool exclusive = false) { return(exclusive ? _items.Any() == entry.GetClasses().Any() && entry.GetClasses().All(c => _items.Any(item => item.Any(rule => rule.ShouldMatch && rule.Class == c))) : !_items.Any() || _items.All(set => set.Any(rule => entry.ContainsClass(rule.Class) == rule.ShouldMatch))); }
/// <summary> /// Determines if the specified dictionary entry passes the filter. /// </summary> /// <param name="entry">The entry to test.</param> /// <param name="exclusive">Specifies whether the search is exclusive.</param> /// <returns></returns> public bool Test(RantDictionaryEntry entry, bool exclusive = false) { return exclusive ? _items.Any() == entry.GetClasses().Any() && entry.GetClasses().All(c => _items.Any(item => item.Any(rule => rule.ShouldMatch && rule.Class == c))) : !_items.Any() || _items.All(set => set.Any(rule => entry.ContainsClass(rule.Class) == rule.ShouldMatch)); }
public bool Test(RantDictionaryEntry entry) { if (!EntryTypeDefFilter.Test(Filter, entry)) { return(true); } return(entry.GetClasses().Where(IsValidValue).Count() == 1); }
public bool Test(RantDictionaryEntry entry) { if (!EntryTypeDefFilter.Test(Filter, entry)) return true; return entry.GetClasses().Where(IsValidValue).Count() == 1; }