Implement and output TypeInfo.BaseType

This commit is contained in:
Katy Coe
2017-11-09 13:21:53 +01:00
parent ff37a7ddeb
commit 1564ead89d
2 changed files with 12 additions and 2 deletions

View File

@@ -21,7 +21,8 @@ namespace Il2CppInspector.Reflection {
public TypeAttributes Attributes { get; }
// Type that this type inherits from
public TypeInfo BaseType => throw new NotImplementedException();
private Il2CppType baseType;
public TypeInfo BaseType => baseType != null? Assembly.Model.GetType(baseType, MemberTypes.TypeInfo) : null;
// True if the type contains unresolved generic type parameters
public bool ContainsGenericParameters { get; }
@@ -121,6 +122,9 @@ namespace Il2CppInspector.Reflection {
Namespace = pkg.Strings[Definition.namespaceIndex];
Name = pkg.Strings[pkg.TypeDefinitions[typeIndex].nameIndex];
if (Definition.parentIndex >= 0)
baseType = pkg.TypeUsages[Definition.parentIndex];
if ((Definition.flags & Il2CppConstants.TYPE_ATTRIBUTE_SERIALIZABLE) != 0)
Attributes |= TypeAttributes.Serializable;
if ((Definition.flags & Il2CppConstants.TYPE_ATTRIBUTE_VISIBILITY_MASK) == Il2CppConstants.TYPE_ATTRIBUTE_PUBLIC)