0
0
mirror of https://github.com/sp-tarkov/assembly-tool.git synced 2025-02-13 08:10:45 -05:00

120 lines
3.6 KiB
C#
Raw Normal View History

2025-01-11 05:34:45 -05:00
using System.Text.Json.Serialization;
using dnlib.DotNet;
2024-12-31 13:46:44 -05:00
using ReCodeItLib.Enums;
2024-06-13 01:46:51 -04:00
2024-12-31 13:46:44 -05:00
namespace ReCodeItLib.Models;
2024-06-12 00:05:59 -04:00
/// <summary>
/// Object to store linq statements in inside of json to search and remap classes
/// </summary>
2024-06-13 18:15:52 -04:00
public class RemapModel
2024-06-12 00:05:59 -04:00
{
2024-06-13 01:46:51 -04:00
[JsonIgnore]
public bool Succeeded { get; set; } = false;
[JsonIgnore]
public List<ENoMatchReason> NoMatchReasons { get; set; } = [];
2025-01-11 05:34:45 -05:00
[JsonIgnore]
public string AmbiguousTypeMatch { get; set; } = string.Empty;
2024-06-28 18:38:03 -04:00
/// <summary>
/// This is a list of type candidates that made it through the filter
/// </summary>
[JsonIgnore]
public HashSet<TypeDef> TypeCandidates { get; set; } = [];
/// <summary>
/// This is the final chosen type we will use to remap
/// </summary>
[JsonIgnore]
2024-12-31 03:13:29 -05:00
public TypeDef? TypePrimeCandidate { get; set; }
2024-06-13 01:46:51 -04:00
2024-06-12 00:05:59 -04:00
public string NewTypeName { get; set; } = string.Empty;
public string OriginalTypeName { get; set; } = string.Empty;
public bool UseForceRename { get; set; }
2025-01-01 21:10:31 -05:00
public bool? AutoGenerated { get; set; } = null;
2024-06-12 00:05:59 -04:00
public SearchParams SearchParams { get; set; } = new();
}
/// <summary>
/// Search filters to find types and remap them
/// </summary>
2024-06-13 18:15:52 -04:00
public class SearchParams
2024-06-12 00:05:59 -04:00
{
2025-01-01 02:13:19 -05:00
public GenericParams GenericParams { get; set; } = new();
public MethodParams Methods { get; set; } = new();
public FieldParams Fields { get; set; } = new();
public PropertyParams Properties { get; set; } = new();
public NestedTypeParams NestedTypes { get; set; } = new();
public EventParams Events { get; set; } = new();
}
2024-06-13 04:56:08 -04:00
2025-01-01 02:13:19 -05:00
public class GenericParams
{
public bool IsPublic { get; set; } = true;
2025-01-10 06:35:51 -05:00
public bool IsAbstract { get; set; }
public bool IsInterface { get; set; }
2025-01-10 09:00:03 -05:00
public bool IsEnum { get; set; }
2025-01-10 06:35:51 -05:00
public bool IsSealed { get; set; }
2025-01-01 02:13:19 -05:00
public bool? HasAttribute { get; set; } = null;
2025-01-10 09:29:38 -05:00
public bool HasGenericParameters { get; set; }
2025-01-01 02:13:19 -05:00
public bool? IsDerived { get; set; } = null;
/// <summary>
/// Name of the derived classes declaring type
/// </summary>
2024-06-13 04:56:08 -04:00
public string? MatchBaseClass { get; set; } = null;
2025-01-01 01:34:11 -05:00
}
2024-06-13 04:56:08 -04:00
2025-01-01 01:34:11 -05:00
public class MethodParams
{
public int ConstructorParameterCount { get; set; } = -1;
public int MethodCount { get; set; } = -1;
2025-01-01 20:37:49 -05:00
public HashSet<string> IncludeMethods { get; set; } = [];
public HashSet<string> ExcludeMethods { get; set; } = [];
2025-01-01 01:34:11 -05:00
}
2024-06-13 04:56:08 -04:00
2025-01-01 01:34:11 -05:00
public class FieldParams
{
public int FieldCount { get; set; } = -1;
2025-01-01 20:37:49 -05:00
public HashSet<string> IncludeFields { get; set; } = [];
public HashSet<string> ExcludeFields { get; set; } = [];
2025-01-01 01:34:11 -05:00
}
2024-06-13 04:56:08 -04:00
2025-01-01 01:34:11 -05:00
public class PropertyParams
{
public int PropertyCount { get; set; } = -1;
2025-01-01 20:37:49 -05:00
public HashSet<string> IncludeProperties { get; set; } = [];
public HashSet<string> ExcludeProperties { get; set; } = [];
2025-01-01 01:34:11 -05:00
}
2024-06-12 00:05:59 -04:00
2025-01-01 01:34:11 -05:00
public class NestedTypeParams
{
2025-01-01 22:12:50 -05:00
public bool IsNested { get; set; }
public bool IsNestedAssembly { get; set; }
public bool IsNestedFamily { get; set; }
public bool IsNestedPrivate { get; set; }
public bool IsNestedPublic { get; set; }
public bool IsNestedFamilyAndAssembly { get; set; }
public bool IsNestedFamilyOrAssembly { get; set; }
/// <summary>
/// Name of the nested types parent
/// </summary>
2025-01-01 22:12:50 -05:00
public string NestedTypeParentName { get; set; } = string.Empty;
2025-01-01 01:34:11 -05:00
public int NestedTypeCount { get; set; } = -1;
2025-01-01 20:37:49 -05:00
public HashSet<string> IncludeNestedTypes { get; set; } = [];
public HashSet<string> ExcludeNestedTypes { get; set; } = [];
2024-06-12 15:47:11 -04:00
}
2025-01-01 01:34:11 -05:00
public class EventParams
2024-06-12 15:47:11 -04:00
{
public int EventCount { get; set; } = -1;
2025-01-01 20:37:49 -05:00
public HashSet<string> IncludeEvents { get; set; } = [];
public HashSet<string> ExcludeEvents { get; set; } = [];
2024-06-12 00:05:59 -04:00
}