public Field[] GetFields(uint hash = 0) { CheckValidity(); IntPtr fields = APIWrapper.ConfigScope_GetFields(NativeInstance, hash, true, out uint count); return(RegisterChildren(MemUtils.IntPtrToWrapperArray <Field>(fields, (int)count))); }
public Config[] GetConfigs(ConfigType cfgType) { CheckValidity(); IntPtr ptr = APIWrapper.Level_GetConfigs(NativeInstance, (uint)cfgType, out int count); if (ptr == IntPtr.Zero) { return(new Config[0]); } return(RegisterChildren(MemUtils.IntPtrToWrapperArray <Config>(ptr, count))); }
internal override void SetPtr(IntPtr modelPtr) { base.SetPtr(modelPtr); if (APIWrapper.Model_FetchSimpleFields(modelPtr, out IntPtr namePtr, out bool isSkinned, out bool isSkeletonBroken, out segmentArray, out segmentCount, out segmentIncrement, out IntPtr boneArr, out int boneCount, out int boneInc, out collisionMeshPtr)) { IsSkinned = isSkinned; IsSkeletonBroken = isSkeletonBroken; Name = Marshal.PtrToStringAnsi(namePtr); Skeleton = new ReadOnlyCollection <Bone>(RegisterChildren(MemUtils.IntPtrToWrapperArray <Bone>(boneArr, boneCount, boneInc))); } }
public T[] Get <T>() where T : NativeWrapper, new() { CheckValidity(); T[] wrappers = new T[0]; if (WrapperTypeMapping.ContainsKey(typeof(T))) { IntPtr ptr = APIWrapper.Level_GetWrappers(NativeInstance, WrapperTypeMapping[typeof(T)], out uint num, out uint inc); wrappers = MemUtils.IntPtrToWrapperArray <T>(ptr, (int)num, (int)inc); for (int i = 0; i < wrappers.Length; i++) { RegisterChild(wrappers[i]); } } return(wrappers); }
public Region[] GetRegions() { CheckValidity(); return(RegisterChildren(MemUtils.IntPtrToWrapperArray <Region>(regionArray, regionCount, regionIncrement))); }
public Instance[] GetInstances() { CheckValidity(); return(RegisterChildren(MemUtils.IntPtrToWrapperArray <Instance>(instanceArray, instanceCount, instanceIncrement))); }
public CollisionPrimitive[] GetPrimitivesMasked(uint mask = 0xffffffff) { CheckValidity(); APIWrapper.Model_GetPrimitivesMasked(NativeInstance, mask, out int numPrims, out IntPtr ptr); return(RegisterChildren(MemUtils.IntPtrToWrapperArray <CollisionPrimitive>(ptr, numPrims))); }
public Segment[] GetSegments() { CheckValidity(); return(RegisterChildren(MemUtils.IntPtrToWrapperArray <Segment>(segmentArray, segmentCount, segmentIncrement))); }