Implement MemberInfo, FieldInfo, TypeInfo.DeclaredFields
Rename Type to TypeInfo Add TypeInfo.CSharpName Implement some generic types/parameters Implement arrays Remove obsolete Il2CppType.GetTypeFromTypeIndex Implement enhanced Il2CppReflector.GetTypeFromTypeIndex (can create array and generic types on-the-fly from Il2CppType usages)
This commit is contained in:
@@ -4,21 +4,35 @@ using System.Reflection;
|
||||
namespace Il2CppInspector.Reflection {
|
||||
public abstract class MemberInfo
|
||||
{
|
||||
// Assembly that this member is defined in
|
||||
public Assembly Assembly { get; set; }
|
||||
// Assembly that this member is defined in. Only set when MemberType == TypeInfo
|
||||
public Assembly Assembly { get; }
|
||||
|
||||
// Custom attributes for this member
|
||||
public IEnumerable<CustomAttributeData> CustomAttributes { get; set; } // TODO
|
||||
public IEnumerable<CustomAttributeData> CustomAttributes { get; } // TODO
|
||||
|
||||
// Type that this type is declared in for nested types
|
||||
public Type DeclaringType { get; set; } // TODO
|
||||
public TypeInfo DeclaringType { get; }
|
||||
|
||||
// What sort of member this is, eg. method, field etc.
|
||||
public MemberTypes MemberType { get; set; } // TODO
|
||||
public abstract MemberTypes MemberType { get; }
|
||||
|
||||
// Name of the member
|
||||
public string Name { get; set; }
|
||||
public virtual string Name { get; protected set; }
|
||||
|
||||
// TODO: GetCustomAttributes etc.
|
||||
|
||||
// For top-level members in an assembly (ie. non-nested types)
|
||||
protected MemberInfo(Assembly asm, TypeInfo declaringType = null) {
|
||||
Assembly = asm;
|
||||
DeclaringType = declaringType;
|
||||
}
|
||||
|
||||
// For lower level members, eg. fields, properties etc. and nested types
|
||||
protected MemberInfo(TypeInfo declaringType) {
|
||||
if (declaringType != null) {
|
||||
Assembly = declaringType.Assembly;
|
||||
DeclaringType = declaringType;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user