mirror of
https://github.com/LukeFZ/Il2CppInspectorRedux.git
synced 2025-12-31 15:49:52 +05:00
Implement and output TypeInfo.InterfaceUsageIndices
This commit is contained in:
@@ -67,6 +67,10 @@ namespace Il2CppInspector.Reflection {
|
||||
public List<TypeInfo> GenericTypeParameters { get; }
|
||||
|
||||
public bool HasElementType => ElementType != null;
|
||||
|
||||
private Il2CppType[] implementedInterfaces;
|
||||
public IEnumerable<TypeInfo> ImplementedInterfaces => implementedInterfaces.Select(x => Assembly.Model.GetType(x, MemberTypes.TypeInfo));
|
||||
|
||||
public bool IsAbstract => (Attributes & TypeAttributes.Abstract) == TypeAttributes.Abstract;
|
||||
public bool IsArray { get; }
|
||||
public bool IsByRef => throw new NotImplementedException();
|
||||
@@ -140,6 +144,11 @@ namespace Il2CppInspector.Reflection {
|
||||
if (!IsInterface)
|
||||
Attributes |= TypeAttributes.Class;
|
||||
|
||||
// Add all implemented interfaces
|
||||
implementedInterfaces = new Il2CppType[Definition.interfaces_count];
|
||||
for (var i = 0; i < Definition.interfaces_count; i++)
|
||||
implementedInterfaces[i] = pkg.TypeUsages[pkg.Metadata.InterfaceUsageIndices[Definition.interfacesStart + i]];
|
||||
|
||||
// Add all fields
|
||||
for (var f = Definition.fieldStart; f < Definition.fieldStart + Definition.field_count; f++)
|
||||
DeclaredFields.Add(new FieldInfo(pkg, f, this));
|
||||
|
||||
Reference in New Issue
Block a user