コード例 #1
0
        /// <summary>
        ///     Check whether the specified user is allowed to create the given inventory type in their inventory.
        /// </summary>
        /// <param name="invType"></param>
        /// <param name="userID"></param>
        /// <returns></returns>
        public bool CanCreateUserInventory(int invType, UUID userID)
        {
            CreateUserInventoryHandler handler = OnCreateUserInventory;

            if (handler != null)
            {
                Delegate[] list = handler.GetInvocationList();
                return(list.Cast <CreateUserInventoryHandler>().All(h => h(invType, userID) != false));
            }
            return(true);
        }
コード例 #2
0
        /// <summary>
        /// Check whether the specified user is allowed to create the given inventory type in their inventory.
        /// </summary>
        /// <param name="invType"></param>
        /// <param name="userID"></param>
        /// <returns></returns>
        public bool CanCreateUserInventory(int invType, UUID userID)
        {
            CreateUserInventoryHandler handler = OnCreateUserInventory;

            if (handler != null)
            {
                Delegate[] list = handler.GetInvocationList();
                foreach (CreateUserInventoryHandler h in list)
                {
                    if (h(invType, userID) == false)
                    {
                        return(false);
                    }
                }
            }
            return(true);
        }