Ejemplo n.º 1
0
        public bool Equals(WeakObject <T> other)
        {
            //Don't trip up on nulls
            if (other == null)
            {
                return(false);
            }

            if (Data.ObjectIndex == other.Data.ObjectIndex &&
                Data.ObjectSerialNumber == other.Data.ObjectSerialNumber)
            {
                return(true);
            }

            T thisObject  = Object;
            T otherObject = other.Object;

            if (thisObject == null && otherObject == null)
            {
                return(true);
            }
            else if (thisObject == null || otherObject == null)
            {
                return(false);
            }
            else
            {
                return(thisObject.Equals(otherObject));
            }
        }
Ejemplo n.º 2
0
        public override bool Equals(object obj)
        {
            WeakObject <T> other = obj as WeakObject <T>;

            if (other != null)
            {
                return(Equals(other));
            }

            return(false);
        }
Ejemplo n.º 3
0
        public static void ToNative(IntPtr nativeBuffer, int arrayIndex, UnrealObject owner, WeakObject <T> obj)
        {
            IntPtr elementPtr = nativeBuffer + arrayIndex * WeakObject <T> .NativeSize;

            if (obj != null)
            {
                obj.ToNative(elementPtr);
            }
            else
            {
                new WeakObject <T>().ToNative(elementPtr);
            }
        }