Beispiel #1
0
 /// <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)));
 }
Beispiel #2
0
		/// <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));
		}
Beispiel #3
0
 public bool Test(RantDictionaryEntry entry)
 {
     if (!EntryTypeDefFilter.Test(Filter, entry))
     {
         return(true);
     }
     return(entry.GetClasses().Where(IsValidValue).Count() == 1);
 }
Beispiel #4
0
 public bool Test(RantDictionaryEntry entry)
 {
     if (!EntryTypeDefFilter.Test(Filter, entry)) return true;
     return entry.GetClasses().Where(IsValidValue).Count() == 1;
 }