OpenSim.Region.ScriptEngine.Shared.Api.LSL_Api.llGetInventoryNumber C# (CSharp) Method

llGetInventoryNumber() public method

public llGetInventoryNumber ( int type ) : OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLInteger
type int
return OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLInteger
        public LSL_Integer llGetInventoryNumber(int type)
        {
            m_host.AddScriptLPS(1);
            int count = 0;

            m_host.TaskInventory.LockItemsForRead(true);
            foreach (KeyValuePair<UUID, TaskInventoryItem> inv in m_host.TaskInventory)
            {
                if (inv.Value.Type == type || type == -1)
                {
                    count = count + 1;
                }
            }
            
            m_host.TaskInventory.LockItemsForRead(false);
            return count;
        }
LSL_Api