Esempio n. 1
0
        public virtual bool TryGetValue(UObject worldContextObject, out T value)
        {
            IntPtr world = Native_UObject.GetWorld(worldContextObject.Address);

            if (worldTypeFlags == 0)
            {
                if (values.TryGetValue(world, out value))
                {
                    return(true);
                }
            }
            else if (world != IntPtr.Zero)
            {
                int worldType = (1 << (int)Native_UWorld.Get_WorldType(world));
                if ((worldTypeFlags & worldType) == worldType)
                {
                    if (values.TryGetValue(world, out value))
                    {
                        return(true);
                    }
                }
            }
            value = default(T);
            return(false);
        }
Esempio n. 2
0
        public virtual bool HasValue(UObject worldContextObject)
        {
            IntPtr world = Native_UObject.GetWorld(worldContextObject.Address);

            if (worldTypeFlags == 0)
            {
                return(values.ContainsKey(world));
            }
            else if (world != IntPtr.Zero)
            {
                int worldType = (1 << (int)Native_UWorld.Get_WorldType(world));
                if ((worldTypeFlags & worldType) == worldType)
                {
                    return(values.ContainsKey(world));
                }
            }
            return(false);
        }
Esempio n. 3
0
        public virtual bool Set(UObject worldContextObject, T value)
        {
            IntPtr world = Native_UObject.GetWorld(worldContextObject.Address);

            if (worldTypeFlags == 0)
            {
                values[world] = value;
                return(true);
            }
            else if (world != IntPtr.Zero)
            {
                int worldType = (1 << (int)Native_UWorld.Get_WorldType(world));
                if ((worldTypeFlags & worldType) == worldType)
                {
                    values[world] = value;
                    return(true);
                }
            }
            return(false);
        }