Aurora.ScriptEngine.AuroraDotNetEngine.APIs.LSL_Api.llGetInventoryNumber C# (CSharp) Method

llGetInventoryNumber() public method

public llGetInventoryNumber ( int type ) : Aurora.ScriptEngine.AuroraDotNetEngine.LSL_Types.LSLInteger
type int
return Aurora.ScriptEngine.AuroraDotNetEngine.LSL_Types.LSLInteger
        public LSL_Integer llGetInventoryNumber(int type)
        {
            if (!ScriptProtection.CheckThreatLevel(ThreatLevel.None, "LSL", m_host, "LSL", m_itemID)) return 0;

            int count = 0;

            lock (m_host.TaskInventory)
            {
#if (!ISWIN)
                foreach (TaskInventoryItem item in m_host.TaskInventory.Values)
                    if (item.Type == type || type == -1)
                        count++;
#else
                count += m_host.TaskInventory.Values.Count(item => item.Type == type || type == -1);
#endif
            }

            return count;
        }
LSL_Api