Esempio n. 1
0
        public void AddPair(IntPtr keyPtr, IntPtr valuePtr)
        {
            IntPtr localKeyPropForCapture   = keyProp;
            IntPtr localValuePropForCapture = valueProp;

            HashDelegates.GetKeyHash keyHash = delegate(IntPtr elementKey)
            {
                return(Native_UProperty.GetValueTypeHash(localKeyPropForCapture, elementKey));
            };
            HashDelegates.Equality keyEquality = delegate(IntPtr a, IntPtr b)
            {
                return(Native_UProperty.Identical(localKeyPropForCapture, a, b, 0));
            };
            HashDelegates.ConstructAndAssign keyConstructAndAssign = delegate(IntPtr newElementKey)
            {
                if (Native_UProperty.HasAnyPropertyFlags(localKeyPropForCapture, EPropertyFlags.ZeroConstructor))
                {
                    FMemory.Memzero(newElementKey, Native_UProperty.GetSize(localKeyPropForCapture));
                }
                else
                {
                    Native_UProperty.InitializeValue(localKeyPropForCapture, newElementKey);
                }

                Native_UProperty.CopySingleValue(localKeyPropForCapture, newElementKey, keyPtr);
            };
            HashDelegates.ConstructAndAssign valueConstructAndAssign = delegate(IntPtr newElementValue)
            {
                if (Native_UProperty.HasAnyPropertyFlags(localValuePropForCapture, EPropertyFlags.ZeroConstructor))
                {
                    FMemory.Memzero(newElementValue, Native_UProperty.GetSize(localValuePropForCapture));
                }
                else
                {
                    Native_UProperty.InitializeValue(localValuePropForCapture, newElementValue);
                }

                Native_UProperty.CopySingleValue(localValuePropForCapture, newElementValue, valuePtr);
            };
            HashDelegates.Assign valueAssign = delegate(IntPtr existingElementValue)
            {
                Native_UProperty.CopySingleValue(localValuePropForCapture, existingElementValue, valuePtr);
            };
            HashDelegates.Destruct keyDestruct = delegate(IntPtr elementKey)
            {
                if (!Native_UProperty.HasAnyPropertyFlags(localKeyPropForCapture, EPropertyFlags.IsPlainOldData | EPropertyFlags.NoDestructor))
                {
                    Native_UProperty.DestroyValue(localKeyPropForCapture, elementKey);
                }
            };
            HashDelegates.Destruct valueDestruct = delegate(IntPtr elementValue)
            {
                if (!Native_UProperty.HasAnyPropertyFlags(localValuePropForCapture, EPropertyFlags.IsPlainOldData | EPropertyFlags.NoDestructor))
                {
                    Native_UProperty.DestroyValue(localValuePropForCapture, elementValue);
                }
            };
            map->Add(keyPtr, valuePtr, ref mapLayout, keyHash, keyEquality, keyConstructAndAssign, valueConstructAndAssign,
                     valueAssign, keyDestruct, valueDestruct);
        }
Esempio n. 2
0
        public static FScriptSetHelper CreateHelperFormInnerProperty(IntPtr elementProperty, IntPtr set)
        {
            FScriptSetHelper scriptSetHelper = new FScriptSetHelper();

            scriptSetHelper.elementProp = elementProperty;
            scriptSetHelper.set         = (FScriptSet *)set;
            scriptSetHelper.setLayout   = FScriptSet.GetScriptLayout(
                Native_UProperty.GetSize(elementProperty), Native_UProperty.GetMinAlignment(elementProperty));
            return(scriptSetHelper);
        }
Esempio n. 3
0
        public static FScriptMapHelper CreateHelperFormInnerProperty(IntPtr keyProperty, IntPtr valProperty, IntPtr map)
        {
            FScriptMapHelper scriptMapHelper = new FScriptMapHelper();

            scriptMapHelper.keyProp   = keyProperty;
            scriptMapHelper.valueProp = valProperty;
            scriptMapHelper.map       = (FScriptMap *)map;
            scriptMapHelper.mapLayout = FScriptMap.GetScriptLayout(
                Native_UProperty.GetSize(keyProperty), Native_UProperty.GetMinAlignment(keyProperty),
                Native_UProperty.GetSize(valProperty), Native_UProperty.GetMinAlignment(valProperty));
            return(scriptMapHelper);
        }
Esempio n. 4
0
        public static int GetPropertyArrayElementSize(IntPtr unrealStruct, string propertyName)
        {
            if (unrealStruct == IntPtr.Zero)
            {
                return(0);
            }
            IntPtr arrayProperty = FindField(Classes.UArrayProperty, unrealStruct, propertyName);

            if (arrayProperty == IntPtr.Zero)
            {
                return(0);
            }
            IntPtr innerProperty = Native_UArrayProperty.Get_Inner(arrayProperty);

            return(Native_UProperty.GetSize(innerProperty));
        }
Esempio n. 5
0
        /// <summary>
        /// Adds the element to the set, returning true if the element was added, or false if the element was already present
        /// </summary>
        public void AddElement(IntPtr elementToAdd)
        {
            IntPtr localElementPropForCapture = elementProp;

            HashDelegates.GetKeyHash elementHash = delegate(IntPtr elementKey)
            {
                return(Native_UProperty.GetValueTypeHash(localElementPropForCapture, elementKey));
            };
            HashDelegates.Equality elementEquality = delegate(IntPtr a, IntPtr b)
            {
                return(Native_UProperty.Identical(localElementPropForCapture, a, b, 0));
            };
            HashDelegates.Construct elementConstruct = delegate(IntPtr newElement)
            {
                if (Native_UProperty.HasAnyPropertyFlags(localElementPropForCapture, EPropertyFlags.ZeroConstructor))
                {
                    FMemory.Memzero(newElement, Native_UProperty.GetSize(localElementPropForCapture));
                }
                else
                {
                    Native_UProperty.InitializeValue(localElementPropForCapture, newElement);
                }

                Native_UProperty.CopySingleValue(localElementPropForCapture, newElement, elementToAdd);
            };
            HashDelegates.Destruct elementDestruct = delegate(IntPtr element)
            {
                if (!Native_UProperty.HasAnyPropertyFlags(localElementPropForCapture, EPropertyFlags.IsPlainOldData | EPropertyFlags.NoDestructor))
                {
                    Native_UProperty.DestroyValue(localElementPropForCapture, element);
                }
            };
            set->Add(
                elementToAdd,
                ref setLayout,
                elementHash,
                elementEquality,
                elementConstruct,
                elementDestruct);
        }
Esempio n. 6
0
 public int GetSize()
 {
     return(Native_UProperty.GetSize(Address));
 }