Ejemplo n.º 1
0
 public bool isEntityKnown(NetworkEntityGuid guid)
 {
     LockObject.EnterReadLock();
     try
     {
         return(InternalKnownSet.Contains(guid));
     }
     finally
     {
         LockObject.ExitReadLock();
     }
 }
Ejemplo n.º 2
0
        /// <inheritdoc />
        public void AddEntity(NetworkEntityGuid guid)
        {
            LockObject.EnterWriteLock();
            try
            {
                if (isEntityKnown(guid))
                {
                    throw new InvalidOperationException($"Cannot add EntityGuid: {guid} because it already exists in Set: {nameof(DefaultThreadUnSafeKnownEntitySet)}.");
                }

                InternalKnownSet.Add(guid);
            }
            finally
            {
                LockObject.ExitWriteLock();
            }
        }