/// <summary> /// will return all encounters. will also recursively search base classes, if existent /// </summary> public bool GetProperty(string propName, out string[] propValues) { CheckValidity(); if (APIWrapper.Instance_GetPropertiesFromName(NativeInstance, propName, out IntPtr res, out uint count)) { propValues = MemUtils.IntPtrToStringList(res, (int)count).ToArray(); return(true); }
/// <summary> /// will return all encounters. will also recursively search base classes, if existent /// </summary> public bool GetProperty(uint hashedPropName, out string[] propValues) { CheckValidity(); if (APIWrapper.EntityClass_GetPropertiesFromHash(NativeInstance, hashedPropName, out IntPtr res, out uint count)) { propValues = MemUtils.IntPtrToStringList(res, (int)count).ToArray(); return(true); } propValues = null; return(false); }
internal override void SetPtr(IntPtr terPtr) { base.SetPtr(terPtr); if (APIWrapper.Terrain_FetchSimpleFields(terPtr, out int numTexes, out IntPtr texNamesPtr, out float heightUpperBound, out float heightLowerBound, out uint numVertices, out vertexBufferPtr, out uint numNormals, out normalsBufferPtr, out uint numUVs, out uvsBufferPtr)) { HeightUpperBound = heightUpperBound; HeightLowerBound = heightLowerBound; NumVertices = numVertices; NumNormals = numNormals; NumUVs = numUVs; LayerTextures = new ReadOnlyCollection <string>(MemUtils.IntPtrToStringList(texNamesPtr, numTexes)); } }
public bool GetOverriddenProperties(out uint[] properties, out string[] values) { CheckValidity(); bool status = APIWrapper.EntityClass_GetOverriddenProperties(NativeInstance, out IntPtr props, out IntPtr vals, out int count); if (status) { properties = MemUtils.IntPtrToArray <uint>(props, count); values = MemUtils.IntPtrToStringList(vals, count).ToArray(); } else { properties = new uint[0]; values = new string[0]; } return(status); }
internal override void SetPtr(IntPtr ptr) { base.SetPtr(ptr); if (APIWrapper.Material_FetchAllFields(ptr, out IntPtr specular, out IntPtr diffuse, out IntPtr texNames, out int numTexes, out IntPtr attachedLightName, out uint matFlags, out uint specularExponent)) { MaterialFlags = (MaterialFlags)matFlags; SpecularColor = new Vector3(specular); DiffuseColor = new Vector3(diffuse); SpecularExponent = specularExponent; Textures = new ReadOnlyCollection <string>(MemUtils.IntPtrToStringList(texNames, numTexes)); AttachedLight = Marshal.PtrToStringAnsi(attachedLightName); } }