0
0
mirror of https://github.com/sp-tarkov/assembly-tool.git synced 2025-02-12 17:30:43 -05:00

Convert IsSealed, remove IsStruct its covered by other flags

This commit is contained in:
Cj 2025-01-10 08:55:32 -05:00
parent 3fbef827fc
commit 165739eacd
5 changed files with 128 additions and 200 deletions

File diff suppressed because it is too large Load Diff

View File

@ -58,7 +58,6 @@ public class GenericParams
public bool IsPublic { get; set; } = true;
public bool IsAbstract { get; set; }
public bool IsInterface { get; set; }
public bool? IsStruct { get; set; } = null;
public bool? IsEnum { get; set; } = null;
public bool IsSealed { get; set; }
public bool? HasAttribute { get; set; } = null;

View File

@ -145,7 +145,6 @@ public class AutoMatcher(List<RemapModel> mappings, string mappingPath)
parms.IsAbstract = target.IsAbstract;
parms.IsInterface = target.IsInterface;
parms.IsEnum = target.IsEnum;
parms.IsStruct = target.IsValueType && !target.IsEnum;
parms.HasGenericParameters = target.HasGenericParameters;
parms.IsSealed = target.IsSealed;
parms.HasAttribute = target.HasCustomAttributes;

View File

@ -37,20 +37,6 @@ internal static class GenericTypeFilters
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)
{
// Filter based on enum or not

View File

@ -58,15 +58,6 @@ public class TypeFilters
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);
if (!types.Any())