ALFA.GameEffect.GetGameEffectInstance C# (CSharp) Метод

GetGameEffectInstance() приватный статический Метод

Obtain the internal CGameEffect object for this NWEffect instance.
private static GetGameEffectInstance ( NWScript.NWScriptEngineStructure0 Effect ) : IntPtr
Effect NWScript.NWScriptEngineStructure0 Supplies the effect instance to obtain the /// internal instance pointer for.
Результат System.IntPtr
        private static IntPtr GetGameEffectInstance(NWEffect Effect)
        {
            //
            // Obtain the SharedPtr<EngineStructure> pointer from the NWEffect
            // wrapper (and underlying NWScriptEngineStructure).
            //

            IntPtr EngineStructurePtr = (IntPtr)ObtainGetEngineStructurePtr(Effect)(Effect.m_EngineStructure);

            //
            // Read SharedPtr<EngineStructure>.T, obtaining the
            // NWScript Accelerator's EngineStructureBridge pointer.
            //

            IntPtr EngineStructureBridgePtr = (IntPtr)Marshal.ReadIntPtr(EngineStructurePtr, Marshal.SizeOf(typeof(IntPtr)));

            //
            // Read EngineStructureBridge.m_Representation, obtaining the
            // CGameEffect instance.
            //
            // void * __VFN_table;
            // int m_EngineStructureType;
            // CNWVirtualMachineCmdImplementer * m_CmdImplementer;
            // void * m_Representation;
            //

            IntPtr GameEffectInstance = (IntPtr)Marshal.ReadIntPtr(EngineStructureBridgePtr, Marshal.SizeOf(typeof(IntPtr)) + sizeof(int) + Marshal.SizeOf(typeof(IntPtr)));

            return GameEffectInstance;
        }