Refactor TypeInfo names and fix out/in
Replace the deeply nested ternaries in TypeInfo with if-statements for clarity. Remove in/out from CSharpName, keeping it only on immediate type params in CSharpTypeDeclarationName (refactored to a method). Rearrange name-related properties and methods to group them all together into a region for easier navigation.
This commit is contained in:
@@ -76,7 +76,7 @@ namespace Il2CppInspector.Reflection
|
||||
((Func<string>)(() => {
|
||||
// This is some shenanigans because IL2CPP does not use a consistent naming scheme for explicit interface implementation method names
|
||||
var implementingInterface = DeclaringType.ImplementedInterfaces.FirstOrDefault(i => Name.StartsWith(i.Namespace + "." + i.CSharpName + "."))
|
||||
?? DeclaringType.ImplementedInterfaces.FirstOrDefault(i => Name.StartsWith(i.Namespace + "." + i.CSharpTypeDeclarationName.Replace(" ", "") + "."));
|
||||
?? DeclaringType.ImplementedInterfaces.FirstOrDefault(i => Name.StartsWith(i.Namespace + "." + i.GetCSharpTypeDeclarationName().Replace(" ", "") + "."));
|
||||
// TODO: There are some combinations we haven't dealt with so use this test as a safety valve
|
||||
if (implementingInterface == null)
|
||||
return Name;
|
||||
|
||||
Reference in New Issue
Block a user