Implement and output TypeInfo.InterfaceUsageIndices

This commit is contained in:
Katy Coe
2017-11-09 14:24:37 +01:00
parent 3722705301
commit 35db6cabd6
3 changed files with 16 additions and 3 deletions

View File

@@ -39,8 +39,10 @@ namespace Il2CppInspector
else
writer.Write("class ");
var baseText = type.BaseType?.CSharpName ?? string.Empty;
baseText = (baseText == "object" || baseText == "ValueType" || baseText == string.Empty)? string.Empty : " : " + baseText;
var @base = type.ImplementedInterfaces.Select(x => x.CSharpName).ToList();
if (type.BaseType != null && type.BaseType.FullName != "System.Object" && type.BaseType.FullName != "System.ValueType")
@base.Insert(0, type.BaseType.CSharpName);
var baseText = @base.Count > 0 ? " : " + string.Join(", ", @base) : string.Empty;
writer.Write($"{type.Name}{baseText} // TypeDefIndex: {type.Index}\n{{\n");