mirror of
https://github.com/sp-tarkov/assembly-tool.git
synced 2025-02-12 22:50:45 -05:00
Make lists into hashsets
This commit is contained in:
parent
9f2165f325
commit
2cf25373fe
@ -16422,5 +16422,171 @@
|
|||||||
"ExcludeEvents": []
|
"ExcludeEvents": []
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"NewTypeName": "PlantState",
|
||||||
|
"OriginalTypeName": "GClass1895",
|
||||||
|
"UseForceRename": false,
|
||||||
|
"SearchParams": {
|
||||||
|
"GenericParams": {
|
||||||
|
"IsPublic": true,
|
||||||
|
"IsAbstract": false,
|
||||||
|
"IsInterface": false,
|
||||||
|
"IsStruct": false,
|
||||||
|
"IsEnum": false,
|
||||||
|
"IsNested": false,
|
||||||
|
"IsSealed": true,
|
||||||
|
"HasAttribute": false,
|
||||||
|
"HasGenericParameters": false
|
||||||
|
},
|
||||||
|
"Methods": {
|
||||||
|
"ConstructorParameterCount": 1,
|
||||||
|
"MethodCount": 9,
|
||||||
|
"IncludeMethods": [
|
||||||
|
"Enter",
|
||||||
|
"Exit",
|
||||||
|
"ManualAnimatorMoveUpdate",
|
||||||
|
"ChangePose",
|
||||||
|
"SetTilt",
|
||||||
|
"Pickup",
|
||||||
|
"Examine",
|
||||||
|
"Plant",
|
||||||
|
"Cancel"
|
||||||
|
],
|
||||||
|
"ExcludeMethods": [
|
||||||
|
"Dispose",
|
||||||
|
"smethod_0",
|
||||||
|
"method_0",
|
||||||
|
"smethod_1",
|
||||||
|
"method_1",
|
||||||
|
"method_2",
|
||||||
|
"Pause",
|
||||||
|
"Resume",
|
||||||
|
"method_3",
|
||||||
|
"Begin",
|
||||||
|
"End",
|
||||||
|
"GetIcon",
|
||||||
|
"RenderModel",
|
||||||
|
"PoseModelByPivot",
|
||||||
|
"PoseModelByBounds",
|
||||||
|
"GetBounds",
|
||||||
|
"Create",
|
||||||
|
"ChatShared.IChatMember.Add",
|
||||||
|
"ChatShared.IChatMember.Remove",
|
||||||
|
"ChatShared.IChatMember.Receive",
|
||||||
|
"ChatShared.IChatMember.ReceiveReplay",
|
||||||
|
"ChatShared.IChatMember.SetBanned",
|
||||||
|
"ChatShared.IChatMember.SetUnbanned",
|
||||||
|
"ChatShared.IChatMember.Drop",
|
||||||
|
"OnUpdate",
|
||||||
|
"GetEffect",
|
||||||
|
"OnLateUpdate",
|
||||||
|
"method_4",
|
||||||
|
"method_5",
|
||||||
|
"OnDispose",
|
||||||
|
"StartFade",
|
||||||
|
"StopFade",
|
||||||
|
"Clear",
|
||||||
|
"ContainsIndex",
|
||||||
|
"GetNumPixels",
|
||||||
|
"ToIndexArray",
|
||||||
|
"ToSamplesArray",
|
||||||
|
"UnionWith",
|
||||||
|
"GetCellData",
|
||||||
|
"GetPixelData",
|
||||||
|
"DisposeAt",
|
||||||
|
"GetSample",
|
||||||
|
"Remap",
|
||||||
|
"ProcessAnimator",
|
||||||
|
"GInterface109.OnParameterValueChanged",
|
||||||
|
"Serialize",
|
||||||
|
"Deserialize",
|
||||||
|
"UpdateTimers",
|
||||||
|
"HandleExits",
|
||||||
|
"Transit",
|
||||||
|
"InteractWithTransit",
|
||||||
|
"Sizes",
|
||||||
|
"Timers",
|
||||||
|
"method_16",
|
||||||
|
"method_17",
|
||||||
|
"Start",
|
||||||
|
"Stop",
|
||||||
|
"method_6",
|
||||||
|
"add_OnQuit",
|
||||||
|
"remove_OnQuit",
|
||||||
|
"ShowDialogScreen",
|
||||||
|
"ExecuteDialogOption",
|
||||||
|
"ExecuteQuestAction",
|
||||||
|
"ExecuteServiceAction",
|
||||||
|
"SaveDialogState",
|
||||||
|
"add_SearchStopped",
|
||||||
|
"remove_SearchStopped",
|
||||||
|
"add_SearchComplete",
|
||||||
|
"remove_SearchComplete",
|
||||||
|
"Search",
|
||||||
|
"TryPauseFrameRelatedMetrics",
|
||||||
|
"TryResumeFrameRelatedMetrics",
|
||||||
|
"Update",
|
||||||
|
"SetAsCurrent",
|
||||||
|
"add_OnBuffsUpdated",
|
||||||
|
"remove_OnBuffsUpdated",
|
||||||
|
"Add",
|
||||||
|
"Replace",
|
||||||
|
"Remove",
|
||||||
|
"InvokeInternalBuffChange",
|
||||||
|
"EFT.IExplosiveItem.CreateFragment",
|
||||||
|
"Contains",
|
||||||
|
"CanExecute",
|
||||||
|
"RaiseEvents",
|
||||||
|
"RollBack",
|
||||||
|
"Execute",
|
||||||
|
"ExecuteWithNewCount",
|
||||||
|
"GInterface143.SetItemInfo",
|
||||||
|
"GetHashSum",
|
||||||
|
"GetInfo",
|
||||||
|
"ExecuteInternal",
|
||||||
|
"ToDescriptor",
|
||||||
|
"ToString",
|
||||||
|
"ToBaseInventoryCommand",
|
||||||
|
"method_7",
|
||||||
|
"method_8",
|
||||||
|
"method_9",
|
||||||
|
"method_10",
|
||||||
|
"ExecuteInteractionInternal",
|
||||||
|
"IsActive",
|
||||||
|
"IsInteractive",
|
||||||
|
"method_11",
|
||||||
|
"GetCommands",
|
||||||
|
"SetChanges",
|
||||||
|
"Reset",
|
||||||
|
"Rollback",
|
||||||
|
"Save",
|
||||||
|
"AddTask",
|
||||||
|
"CreateThread",
|
||||||
|
"RunInMainTread",
|
||||||
|
"CheckForFinishedTasks",
|
||||||
|
"Kill"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"Fields": {
|
||||||
|
"FieldCount": 2,
|
||||||
|
"IncludeFields": [],
|
||||||
|
"ExcludeFields": []
|
||||||
|
},
|
||||||
|
"Properties": {
|
||||||
|
"PropertyCount": 0,
|
||||||
|
"IncludeProperties": [],
|
||||||
|
"ExcludeProperties": []
|
||||||
|
},
|
||||||
|
"NestedTypes": {
|
||||||
|
"NestedTypeCount": -1,
|
||||||
|
"IncludeNestedTypes": [],
|
||||||
|
"ExcludeNestedTypes": []
|
||||||
|
},
|
||||||
|
"Events": {
|
||||||
|
"IncludeEvents": [],
|
||||||
|
"ExcludeEvents": []
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
@ -26,12 +26,6 @@ public class AutoMatchCommand : ICommand
|
|||||||
{
|
{
|
||||||
DataProvider.IsCli = true;
|
DataProvider.IsCli = true;
|
||||||
DataProvider.LoadAppSettings();
|
DataProvider.LoadAppSettings();
|
||||||
|
|
||||||
var remapperSettings = DataProvider.Settings!.Remapper!.MappingSettings;
|
|
||||||
|
|
||||||
remapperSettings!.RenameFields = true;
|
|
||||||
remapperSettings.RenameProperties = true;
|
|
||||||
remapperSettings.Publicize = true;
|
|
||||||
|
|
||||||
Logger.LogSync("Finding match...");
|
Logger.LogSync("Finding match...");
|
||||||
|
|
||||||
|
@ -247,31 +247,31 @@ public partial class ReCodeItForm : Form
|
|||||||
{
|
{
|
||||||
ConstructorParameterCount = (int)ConstructorCountEnabled.GetCount(ConstuctorCountUpDown),
|
ConstructorParameterCount = (int)ConstructorCountEnabled.GetCount(ConstuctorCountUpDown),
|
||||||
MethodCount = (int)MethodCountEnabled.GetCount(MethodCountUpDown),
|
MethodCount = (int)MethodCountEnabled.GetCount(MethodCountUpDown),
|
||||||
IncludeMethods = GUIHelpers.GetAllEntriesFromListBox(MethodIncludeBox),
|
IncludeMethods = GUIHelpers.GetAllEntriesFromListBox(MethodIncludeBox).ToHashSet(),
|
||||||
ExcludeMethods = GUIHelpers.GetAllEntriesFromListBox(MethodExcludeBox),
|
ExcludeMethods = GUIHelpers.GetAllEntriesFromListBox(MethodExcludeBox).ToHashSet(),
|
||||||
},
|
},
|
||||||
Fields =
|
Fields =
|
||||||
{
|
{
|
||||||
FieldCount = (int)FieldCountEnabled.GetCount(FieldCountUpDown),
|
FieldCount = (int)FieldCountEnabled.GetCount(FieldCountUpDown),
|
||||||
IncludeFields = GUIHelpers.GetAllEntriesFromListBox(FieldIncludeBox),
|
IncludeFields = GUIHelpers.GetAllEntriesFromListBox(FieldIncludeBox).ToHashSet(),
|
||||||
ExcludeFields = GUIHelpers.GetAllEntriesFromListBox(FieldExcludeBox),
|
ExcludeFields = GUIHelpers.GetAllEntriesFromListBox(FieldExcludeBox).ToHashSet(),
|
||||||
},
|
},
|
||||||
Properties =
|
Properties =
|
||||||
{
|
{
|
||||||
PropertyCount = (int)PropertyCountEnabled.GetCount(PropertyCountUpDown),
|
PropertyCount = (int)PropertyCountEnabled.GetCount(PropertyCountUpDown),
|
||||||
IncludeProperties = GUIHelpers.GetAllEntriesFromListBox(PropertiesIncludeBox),
|
IncludeProperties = GUIHelpers.GetAllEntriesFromListBox(PropertiesIncludeBox).ToHashSet(),
|
||||||
ExcludeProperties = GUIHelpers.GetAllEntriesFromListBox(PropertiesExcludeBox),
|
ExcludeProperties = GUIHelpers.GetAllEntriesFromListBox(PropertiesExcludeBox).ToHashSet(),
|
||||||
},
|
},
|
||||||
NestedTypes =
|
NestedTypes =
|
||||||
{
|
{
|
||||||
NestedTypeCount = (int)NestedTypeCountEnabled.GetCount(NestedTypeCountUpDown),
|
NestedTypeCount = (int)NestedTypeCountEnabled.GetCount(NestedTypeCountUpDown),
|
||||||
IncludeNestedTypes = GUIHelpers.GetAllEntriesFromListBox(NestedTypesIncludeBox),
|
IncludeNestedTypes = GUIHelpers.GetAllEntriesFromListBox(NestedTypesIncludeBox).ToHashSet(),
|
||||||
ExcludeNestedTypes = GUIHelpers.GetAllEntriesFromListBox(NestedTypesExcludeBox),
|
ExcludeNestedTypes = GUIHelpers.GetAllEntriesFromListBox(NestedTypesExcludeBox).ToHashSet(),
|
||||||
},
|
},
|
||||||
Events =
|
Events =
|
||||||
{
|
{
|
||||||
IncludeEvents = GUIHelpers.GetAllEntriesFromListBox(EventsIncludeBox),
|
IncludeEvents = GUIHelpers.GetAllEntriesFromListBox(EventsIncludeBox).ToHashSet(),
|
||||||
ExcludeEvents = GUIHelpers.GetAllEntriesFromListBox(EventsExcludeBox)
|
ExcludeEvents = GUIHelpers.GetAllEntriesFromListBox(EventsExcludeBox).ToHashSet()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -286,7 +286,7 @@ internal static class GUIHelpers
|
|||||||
/// <param name="items"></param>
|
/// <param name="items"></param>
|
||||||
/// <param name="name"></param>
|
/// <param name="name"></param>
|
||||||
/// <returns>A new tree node, or null if the provided list is empty</returns>
|
/// <returns>A new tree node, or null if the provided list is empty</returns>
|
||||||
private static TreeNode GenerateNodeFromList(List<string> items, string name)
|
private static TreeNode GenerateNodeFromList(HashSet<string> items, string name)
|
||||||
{
|
{
|
||||||
var node = new TreeNode(name);
|
var node = new TreeNode(name);
|
||||||
|
|
||||||
|
@ -85,33 +85,33 @@ public class MethodParams
|
|||||||
{
|
{
|
||||||
public int ConstructorParameterCount { get; set; } = -1;
|
public int ConstructorParameterCount { get; set; } = -1;
|
||||||
public int MethodCount { get; set; } = -1;
|
public int MethodCount { get; set; } = -1;
|
||||||
public List<string> IncludeMethods { get; set; } = [];
|
public HashSet<string> IncludeMethods { get; set; } = [];
|
||||||
public List<string> ExcludeMethods { get; set; } = [];
|
public HashSet<string> ExcludeMethods { get; set; } = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
public class FieldParams
|
public class FieldParams
|
||||||
{
|
{
|
||||||
public int FieldCount { get; set; } = -1;
|
public int FieldCount { get; set; } = -1;
|
||||||
public List<string> IncludeFields { get; set; } = [];
|
public HashSet<string> IncludeFields { get; set; } = [];
|
||||||
public List<string> ExcludeFields { get; set; } = [];
|
public HashSet<string> ExcludeFields { get; set; } = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
public class PropertyParams
|
public class PropertyParams
|
||||||
{
|
{
|
||||||
public int PropertyCount { get; set; } = -1;
|
public int PropertyCount { get; set; } = -1;
|
||||||
public List<string> IncludeProperties { get; set; } = [];
|
public HashSet<string> IncludeProperties { get; set; } = [];
|
||||||
public List<string> ExcludeProperties { get; set; } = [];
|
public HashSet<string> ExcludeProperties { get; set; } = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
public class NestedTypeParams
|
public class NestedTypeParams
|
||||||
{
|
{
|
||||||
public int NestedTypeCount { get; set; } = -1;
|
public int NestedTypeCount { get; set; } = -1;
|
||||||
public List<string> IncludeNestedTypes { get; set; } = [];
|
public HashSet<string> IncludeNestedTypes { get; set; } = [];
|
||||||
public List<string> ExcludeNestedTypes { get; set; } = [];
|
public HashSet<string> ExcludeNestedTypes { get; set; } = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
public class EventParams
|
public class EventParams
|
||||||
{
|
{
|
||||||
public List<string> IncludeEvents { get; set; } = [];
|
public HashSet<string> IncludeEvents { get; set; } = [];
|
||||||
public List<string> ExcludeEvents { get; set; } = [];
|
public HashSet<string> ExcludeEvents { get; set; } = [];
|
||||||
}
|
}
|
@ -26,6 +26,12 @@ public class AutoMatcher(List<RemapModel> mappings, string mappingPath)
|
|||||||
.ToList();
|
.ToList();
|
||||||
|
|
||||||
var targetTypeDef = FindTargetType(oldTypeName);
|
var targetTypeDef = FindTargetType(oldTypeName);
|
||||||
|
|
||||||
|
if (targetTypeDef is null)
|
||||||
|
{
|
||||||
|
Logger.LogSync($"Could not target type: {oldTypeName}", ConsoleColor.Red);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Logger.LogSync($"Found target type: {targetTypeDef!.FullName}", ConsoleColor.Green);
|
Logger.LogSync($"Found target type: {targetTypeDef!.FullName}", ConsoleColor.Green);
|
||||||
|
|
||||||
@ -152,10 +158,15 @@ public class AutoMatcher(List<RemapModel> mappings, string mappingPath)
|
|||||||
.Where(m => !m.IsConstructor && !m.IsGetter && !m.IsSetter)
|
.Where(m => !m.IsConstructor && !m.IsGetter && !m.IsSetter)
|
||||||
.Select(s => s.Name.ToString()));
|
.Select(s => s.Name.ToString()));
|
||||||
|
|
||||||
methods.IncludeMethods.Clear();
|
foreach (var include in includeMethods)
|
||||||
methods.IncludeMethods.AddRange(includeMethods);
|
{
|
||||||
|
methods.IncludeMethods.Add(include);
|
||||||
methods.ExcludeMethods.AddRange(excludeMethods);
|
}
|
||||||
|
|
||||||
|
foreach (var exclude in excludeMethods)
|
||||||
|
{
|
||||||
|
methods.ExcludeMethods.Add(exclude);
|
||||||
|
}
|
||||||
|
|
||||||
methods.MethodCount = target.Methods
|
methods.MethodCount = target.Methods
|
||||||
.Count(m => !m.IsConstructor && !m.IsGetter && !m.IsSetter && !m.IsSpecialName);
|
.Count(m => !m.IsConstructor && !m.IsGetter && !m.IsSetter && !m.IsSpecialName);
|
||||||
@ -200,10 +211,15 @@ public class AutoMatcher(List<RemapModel> mappings, string mappingPath)
|
|||||||
.Select(s => s.Name.ToString())
|
.Select(s => s.Name.ToString())
|
||||||
.Except(target.Fields.Select(s => s.Name.ToString()));
|
.Except(target.Fields.Select(s => s.Name.ToString()));
|
||||||
|
|
||||||
fields.IncludeFields.Clear();
|
foreach (var include in includeFields)
|
||||||
fields.IncludeFields.AddRange(includeFields);
|
{
|
||||||
|
fields.IncludeFields.Add(include);
|
||||||
fields.ExcludeFields.AddRange(excludeFields);
|
}
|
||||||
|
|
||||||
|
foreach (var exclude in excludeFields)
|
||||||
|
{
|
||||||
|
fields.ExcludeFields.Add(exclude);
|
||||||
|
}
|
||||||
|
|
||||||
fields.FieldCount = target.Fields.Count;
|
fields.FieldCount = target.Fields.Count;
|
||||||
|
|
||||||
@ -242,10 +258,15 @@ public class AutoMatcher(List<RemapModel> mappings, string mappingPath)
|
|||||||
.Select(s => s.Name.ToString())
|
.Select(s => s.Name.ToString())
|
||||||
.Except(target.Properties.Select(s => s.Name.ToString()));
|
.Except(target.Properties.Select(s => s.Name.ToString()));
|
||||||
|
|
||||||
props.IncludeProperties.Clear();
|
foreach (var include in includeProps)
|
||||||
props.IncludeProperties.AddRange(includeProps);
|
{
|
||||||
|
props.IncludeProperties.Add(include);
|
||||||
props.ExcludeProperties.AddRange(excludeProps);
|
}
|
||||||
|
|
||||||
|
foreach (var exclude in excludeProps)
|
||||||
|
{
|
||||||
|
props.ExcludeProperties.Add(exclude);
|
||||||
|
}
|
||||||
|
|
||||||
props.PropertyCount = target.Properties.Count;
|
props.PropertyCount = target.Properties.Count;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user