Exemple #1
0
        public HashSet <T> FromNative(IntPtr nativeBuffer, int arrayIndex, IntPtr prop)
        {
            IntPtr scriptSetAddress = nativeBuffer + (arrayIndex * Marshal.SizeOf(typeof(FScriptSet)));

            helper.Update(property);
            helper.Set = scriptSetAddress;

            unsafe
            {
                FScriptSet *set    = (FScriptSet *)scriptSetAddress;
                HashSet <T> result = new HashSet <T>();
                int         count  = set->Count;
                for (int i = 0; i < count; ++i)
                {
                    result.Add(elementFromNative(helper.GetElementPtr(i), 0, helper.ElementPropertyAddress));
                }
                return(result);
            }
        }
Exemple #2
0
 public void ToNative(IntPtr nativeBuffer, IEnumerable <T> value)
 {
     helper.Update(property);
     ToNativeInternal(nativeBuffer, 0, value, ref helper, elementToNative);
 }