MCPcopy Create free account
hub / github.com/axhlzy/Il2CppHookScripts / inflate

Method inflate

Il2cppHook/_Ufunc.js:11858–11869  ·  view source on GitHub ↗

Creates a generic instance of the current generic method.

(...classes)

Source from the content-addressed store, hash-verified

11856 }
11857 /** Creates a generic instance of the current generic method. */
11858 inflate(...classes) {
11859 if (!this.isGeneric) {
11860 (0, console_1.raise)(`cannot inflate method ${this.name}: it has no generic parameters`);
11861 }
11862 if (this.genericParameterCount != classes.length) {
11863 (0, console_1.raise)(`cannot inflate method ${this.name}: it needs ${this.genericParameterCount} generic parameter(s), not ${classes.length}`);
11864 }
11865 const types = classes.map(klass => klass.type.object);
11866 const typeArray = Il2Cpp.Array.from(Il2Cpp.Image.corlib.class("System.Type"), types);
11867 const inflatedMethodObject = this.object.method("MakeGenericMethod", 1).invoke(typeArray);
11868 return new Il2Cpp.Method(Il2Cpp.Api._methodGetFromReflection(inflatedMethodObject));
11869 }
11870 /** Invokes this method. */
11871 invoke(...parameters) {
11872 if (!this.isStatic) {

Callers

nothing calls this directly

Calls 6

mapMethod · 0.45
fromMethod · 0.45
classMethod · 0.45
invokeMethod · 0.45
methodMethod · 0.45

Tested by

no test coverage detected