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:
@@ -549,7 +549,7 @@ namespace Il2CppInspector.Outputs
|
||||
//sb.Append(del.ReturnType.CustomAttributes.ToString(prefix, "return: ", emitPointer: !SuppressMetadata, mustCompile: MustCompile));
|
||||
if (del.RequiresUnsafeContext)
|
||||
sb.Append("unsafe ");
|
||||
sb.Append($"delegate {del.ReturnType.GetScopedCSharpName(scope)} {type.CSharpTypeDeclarationName}(");
|
||||
sb.Append($"delegate {del.ReturnType.GetScopedCSharpName(scope)} {type.GetCSharpTypeDeclarationName()}(");
|
||||
sb.Append(del.GetParametersString(scope, !SuppressMetadata) + ");");
|
||||
if (!SuppressMetadata)
|
||||
sb.Append($" // TypeDefIndex: {type.Index}; {del.VirtualAddress.ToAddressString()}");
|
||||
@@ -566,7 +566,7 @@ namespace Il2CppInspector.Outputs
|
||||
@base.Insert(0, type.GetEnumUnderlyingType().GetScopedCSharpName(scope));
|
||||
var baseText = @base.Count > 0 ? " : " + string.Join(", ", @base) : string.Empty;
|
||||
|
||||
sb.Append($"{type.CSharpTypeDeclarationName}{baseText}");
|
||||
sb.Append($"{type.GetCSharpTypeDeclarationName()}{baseText}");
|
||||
if (!SuppressMetadata)
|
||||
sb.Append($" // TypeDefIndex: {type.Index}");
|
||||
sb.Append("\n");
|
||||
|
||||
Reference in New Issue
Block a user