diff --git a/RecodeItLib/AutoMapper/MappingPair.cs b/RecodeItLib/AutoMapper/MappingPair.cs new file mode 100644 index 0000000..ee5543a --- /dev/null +++ b/RecodeItLib/AutoMapper/MappingPair.cs @@ -0,0 +1,50 @@ +using Mono.Cecil; + +namespace ReCodeItLib.AutoMapper; + +/// +/// Represents a match of a field name to obfuscated class +/// +/// +/// +/// +/// +public sealed class MappingPair( + TypeDefinition type, + string name, + bool isInterface, + bool isStruct, + bool isPublic) +{ + public TypeDefinition OriginalTypeDefinition { get; private set; } = type; + + /// + /// The type reference we want to change + /// + public TypeDefinition NewTypeRef { get; set; } + + /// + /// Is this field an interface? + /// + public bool IsInterface { get; set; } = isInterface; + + /// + /// Is this type a struct? + /// + public bool IsStruct { get; set; } = isStruct; + + /// + /// Has this type been renamed? Use for checking for failures at the end + /// + public bool HasBeenRenamed { get; set; } = false; + + /// + /// This is the name we want to change the assembly class to + /// + public string Name { get; set; } = name; + + /// + /// Original name of the property or field type + /// + public string OriginalPropOrFieldName { get; } = name; +} \ No newline at end of file diff --git a/RecodeItLib/AutoMapper/ReCodeItAutoMapper.cs b/RecodeItLib/AutoMapper/ReCodeItAutoMapper.cs index 618f1f7..3ac8a32 100644 --- a/RecodeItLib/AutoMapper/ReCodeItAutoMapper.cs +++ b/RecodeItLib/AutoMapper/ReCodeItAutoMapper.cs @@ -410,51 +410,4 @@ public class ReCodeItAutoMapper Logger.Log($"Failed to rename: {FailureCount} mapping pairs", ConsoleColor.Green); Logger.Log($"------------------------------------------------------------------------", ConsoleColor.Green); } - - /// - /// Represents a match of a field name to obfuscated class - /// - /// - /// - /// - /// - private sealed class MappingPair( - TypeDefinition type, - string name, - bool isInterface, - bool isStruct, - bool isPublic) - { - public TypeDefinition OriginalTypeDefinition { get; private set; } = type; - - /// - /// The type reference we want to change - /// - public TypeDefinition NewTypeRef { get; set; } - - /// - /// Is this field an interface? - /// - public bool IsInterface { get; set; } = isInterface; - - /// - /// Is this type a struct? - /// - public bool IsStruct { get; set; } = isStruct; - - /// - /// Has this type been renamed? Use for checking for failures at the end - /// - public bool HasBeenRenamed { get; set; } = false; - - /// - /// This is the name we want to change the assembly class to - /// - public string Name { get; set; } = name; - - /// - /// Original name of the property or field type - /// - public string OriginalPropOrFieldName { get; } = name; - } } \ No newline at end of file