示例#1
0
        /// <summary>
        /// Removes the given realm from this world instance, deleting the realm in the process.
        /// If it must be reused, you may clone the realm and add the clone to another world.
        /// </summary>
        /// <param name="realm">The realm to remove.</param>
        /// <returns>Returns an awaitable Task</returns>
        public Task RemoveRealmFromWorld(IRealm realm)
        {
            if (realm == null)
            {
                return(Task.FromResult(0));
            }

            if (!this.realms.Contains(realm))
            {
                return(Task.FromResult(0));
            }

            this.realms.Remove(realm);
            return(realm.Delete());
        }
示例#2
0
        /// <summary>
        /// Removes the given realm from this world instance, deleting the realm in the process.
        /// If it must be reused, you may clone the realm and add the clone to another world.
        /// </summary>
        /// <param name="realm">The realm to remove.</param>
        /// <returns>Returns an awaitable Task</returns>
        public Task RemoveRealmFromWorld(IRealm realm)
        {
            if (realm == null)
            {
                return Task.FromResult(0);
            }

            if (!this.realms.Contains(realm))
            {
                return Task.FromResult(0);
            }

            this.realms.Remove(realm);
            return realm.Delete();
        }