Esempio n. 1
0
        /// <summary>
        /// Removes an object from the visible objects list
        /// only run for players, and also removes the player from
        /// the object's visible targets list
        /// </summary>
        public bool RemoveVisibleObject(PhysicsObj obj, bool inverseTarget = true)
        {
            var removed = VisibleObjects.Remove(obj.ID);

            if (inverseTarget)
            {
                obj.ObjMaint.RemoveVisibleTarget(PhysicsObj);
            }

            return(removed);
        }
Esempio n. 2
0
        /// <summary>
        /// Removes an object from the visible objects list
        /// only run for players
        /// and also removes the player from the object's visible targets list
        /// </summary>
        public bool RemoveVisibleObject(PhysicsObj obj, bool inverseTarget = true)
        {
            rwLock.EnterWriteLock();
            try
            {
                var removed = VisibleObjects.Remove(obj.ID, out _);

                if (inverseTarget)
                {
                    obj.ObjMaint.RemoveVisibleTarget(PhysicsObj);
                }

                return(removed);
            }
            finally
            {
                rwLock.ExitWriteLock();
            }
        }