mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
More granular skipping for filters
This commit is contained in:
@@ -194,6 +194,11 @@ namespace SabreTools.Filtering
|
|||||||
|
|
||||||
#endregion // Item-Specific
|
#endregion // Item-Specific
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Determines if any filters have been set
|
||||||
|
/// </summary>
|
||||||
|
public bool HasFilters { get; set; } = false;
|
||||||
|
|
||||||
#endregion // Fields
|
#endregion // Fields
|
||||||
|
|
||||||
#region Constructors
|
#region Constructors
|
||||||
|
|||||||
@@ -57,11 +57,6 @@ namespace SabreTools.Filtering
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public MachineFilter MachineFilter { get; set; }
|
public MachineFilter MachineFilter { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Determines if any filters have been set
|
|
||||||
/// </summary>
|
|
||||||
public bool HasFilters { get; private set; } = false;
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Logging
|
#region Logging
|
||||||
@@ -116,7 +111,7 @@ namespace SabreTools.Filtering
|
|||||||
if (machineField != MachineField.NULL)
|
if (machineField != MachineField.NULL)
|
||||||
{
|
{
|
||||||
MachineFilter.SetFilter(machineField, value, negate);
|
MachineFilter.SetFilter(machineField, value, negate);
|
||||||
HasFilters = true;
|
MachineFilter.HasFilters = true;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -125,7 +120,7 @@ namespace SabreTools.Filtering
|
|||||||
if (datItemField != DatItemField.NULL)
|
if (datItemField != DatItemField.NULL)
|
||||||
{
|
{
|
||||||
DatItemFilter.SetFilter(datItemField, value, negate);
|
DatItemFilter.SetFilter(datItemField, value, negate);
|
||||||
HasFilters = true;
|
DatItemFilter.HasFilters = true;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -384,7 +379,7 @@ namespace SabreTools.Filtering
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
// If no filters were set, return true
|
// If no filters were set, return true
|
||||||
if (HasFilters)
|
if (!MachineFilter.HasFilters && !DatItemFilter.HasFilters)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
InternalStopwatch watch = new InternalStopwatch("Applying filters to DAT");
|
InternalStopwatch watch = new InternalStopwatch("Applying filters to DAT");
|
||||||
@@ -464,9 +459,13 @@ namespace SabreTools.Filtering
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
// Filter on Machine fields
|
// Filter on Machine fields
|
||||||
if (!MachineFilter.PassesFilters(datItem.Machine))
|
if (MachineFilter.HasFilters && !MachineFilter.PassesFilters(datItem.Machine))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
// If we have no DatItemFilters set, just return true
|
||||||
|
if (!DatItemFilter.HasFilters)
|
||||||
|
return true;
|
||||||
|
|
||||||
// Filter on DatItem fields
|
// Filter on DatItem fields
|
||||||
return DatItemFilter.PassesFilters(datItem);
|
return DatItemFilter.PassesFilters(datItem);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -96,6 +96,11 @@ namespace SabreTools.Filtering
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IncludeOfInGame { get; set; }
|
public bool IncludeOfInGame { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Determines if any filters have been set
|
||||||
|
/// </summary>
|
||||||
|
public bool HasFilters { get; set; } = false;
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#endregion // Fields
|
#endregion // Fields
|
||||||
|
|||||||
Reference in New Issue
Block a user