mirror of
https://github.com/sp-tarkov/assembly-tool.git
synced 2025-02-12 17:10:45 -05:00
Convert IsSealed, remove IsStruct its covered by other flags
This commit is contained in:
parent
3fbef827fc
commit
165739eacd
File diff suppressed because it is too large
Load Diff
@ -58,7 +58,6 @@ public class GenericParams
|
|||||||
public bool IsPublic { get; set; } = true;
|
public bool IsPublic { get; set; } = true;
|
||||||
public bool IsAbstract { get; set; }
|
public bool IsAbstract { get; set; }
|
||||||
public bool IsInterface { get; set; }
|
public bool IsInterface { get; set; }
|
||||||
public bool? IsStruct { get; set; } = null;
|
|
||||||
public bool? IsEnum { get; set; } = null;
|
public bool? IsEnum { get; set; } = null;
|
||||||
public bool IsSealed { get; set; }
|
public bool IsSealed { get; set; }
|
||||||
public bool? HasAttribute { get; set; } = null;
|
public bool? HasAttribute { get; set; } = null;
|
||||||
|
@ -145,7 +145,6 @@ public class AutoMatcher(List<RemapModel> mappings, string mappingPath)
|
|||||||
parms.IsAbstract = target.IsAbstract;
|
parms.IsAbstract = target.IsAbstract;
|
||||||
parms.IsInterface = target.IsInterface;
|
parms.IsInterface = target.IsInterface;
|
||||||
parms.IsEnum = target.IsEnum;
|
parms.IsEnum = target.IsEnum;
|
||||||
parms.IsStruct = target.IsValueType && !target.IsEnum;
|
|
||||||
parms.HasGenericParameters = target.HasGenericParameters;
|
parms.HasGenericParameters = target.HasGenericParameters;
|
||||||
parms.IsSealed = target.IsSealed;
|
parms.IsSealed = target.IsSealed;
|
||||||
parms.HasAttribute = target.HasCustomAttributes;
|
parms.HasAttribute = target.HasCustomAttributes;
|
||||||
|
@ -37,20 +37,6 @@ internal static class GenericTypeFilters
|
|||||||
return types;
|
return types;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static IEnumerable<TypeDef> FilterStruct(IEnumerable<TypeDef> types, SearchParams parms)
|
|
||||||
{
|
|
||||||
if (parms.GenericParams.IsStruct is true)
|
|
||||||
{
|
|
||||||
types = types.Where(t => t.IsValueType && !t.IsEnum);
|
|
||||||
}
|
|
||||||
else if (parms.GenericParams.IsStruct is false)
|
|
||||||
{
|
|
||||||
types = types.Where(t => !t.IsValueType);
|
|
||||||
}
|
|
||||||
|
|
||||||
return types;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static IEnumerable<TypeDef> FilterEnum(IEnumerable<TypeDef> types, SearchParams parms)
|
public static IEnumerable<TypeDef> FilterEnum(IEnumerable<TypeDef> types, SearchParams parms)
|
||||||
{
|
{
|
||||||
// Filter based on enum or not
|
// Filter based on enum or not
|
||||||
|
@ -58,15 +58,6 @@ public class TypeFilters
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
types = GenericTypeFilters.FilterStruct(types, mapping.SearchParams);
|
|
||||||
|
|
||||||
if (!types.Any())
|
|
||||||
{
|
|
||||||
AddNoMatchReason(mapping, ENoMatchReason.IsStruct);
|
|
||||||
mapping.TypeCandidates.UnionWith(types);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
types = GenericTypeFilters.FilterEnum(types, mapping.SearchParams);
|
types = GenericTypeFilters.FilterEnum(types, mapping.SearchParams);
|
||||||
|
|
||||||
if (!types.Any())
|
if (!types.Any())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user