예제 #1
0
        internal static Pointer <TSub> ReadSubStructure <TSuper, TSub>(Pointer <TSuper> super)
            where TSub : INativeSubclass <TSuper>
            where TSuper : INativeStructure
        {
            int size = Mem.QuickSizeOf <TSuper>();

            return(super.Add(size).Cast <TSub>());
        }
예제 #2
0
 /// <summary>
 ///     Read relative to base pointer
 /// </summary>
 internal T ReadRelative <T>(int offset) where T : struct
 {
     return(Pointer.Add(offset).ReadAs <T>());
 }
예제 #3
0
        internal void SetDescriptor <T>(int descriptor, T parValue) where T : struct
        {
            var ptr = Pointer.Add(Offsets.ObjectManager.DescriptorOffset).ReadAs <uint>();

            Memory.Reader.Write(new IntPtr(ptr + descriptor), parValue);
        }
예제 #4
0
        /// <summary>
        ///     Get descriptor function to avoid some code
        /// </summary>
        internal T GetDescriptor <T>(int descriptor) where T : struct
        {
            var ptr = Pointer.Add(Offsets.ObjectManager.DescriptorOffset).ReadAs <uint>();

            return(new IntPtr(ptr + descriptor).ReadAs <T>());
        }