Model: Add basic concrete generic method definitions from MethodSpecs
This commit is contained in:
@@ -83,6 +83,7 @@ namespace Il2CppInspector.Reflection
|
||||
// Regular method
|
||||
: Name;
|
||||
|
||||
// Initialize a method from a method definition (MethodDef)
|
||||
protected MethodBase(Il2CppInspector pkg, int methodIndex, TypeInfo declaringType) : base(declaringType) {
|
||||
Definition = pkg.Methods[methodIndex];
|
||||
Index = methodIndex;
|
||||
@@ -141,6 +142,20 @@ namespace Il2CppInspector.Reflection
|
||||
DeclaredParameters.Add(new ParameterInfo(pkg, p, this));
|
||||
}
|
||||
|
||||
// Initialize a method from a concrete generic method (MethodSpec)
|
||||
protected MethodBase(Il2CppModel model, Il2CppMethodSpec spec, TypeInfo declaringType) : base(declaringType) {
|
||||
var methodDef = model.MethodsByDefinitionIndex[spec.methodDefinitionIndex];
|
||||
|
||||
Name = methodDef.Name;
|
||||
Attributes = methodDef.Attributes;
|
||||
|
||||
IsGenericMethod = true;
|
||||
genericArguments = model.ResolveGenericArguments(spec.methodIndexIndex);
|
||||
|
||||
// TODO: Substitute generic type arguments for concrete type arguments
|
||||
// TODO: Populate VirtualAddress via Il2CppGenericMethodFunctionsDefinitions
|
||||
}
|
||||
|
||||
public string GetAccessModifierString() => this switch {
|
||||
// Static constructors can not have an access level modifier
|
||||
{ IsConstructor: true, IsStatic: true } => "",
|
||||
|
||||
Reference in New Issue
Block a user