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

llList2Integer() public method

public llList2Integer ( Aurora.ScriptEngine.AuroraDotNetEngine.LSL_Types.list src, int index ) : Aurora.ScriptEngine.AuroraDotNetEngine.LSL_Types.LSLInteger
src Aurora.ScriptEngine.AuroraDotNetEngine.LSL_Types.list
index int
return Aurora.ScriptEngine.AuroraDotNetEngine.LSL_Types.LSLInteger
        public LSL_Integer llList2Integer(LSL_List src, int index)
        {
            if (!ScriptProtection.CheckThreatLevel(ThreatLevel.None, "LSL", m_host, "LSL", m_itemID)) return 0;

            if (index < 0)
            {
                index = src.Length + index;
            }
            if (index >= src.Length || index < 0)
            {
                return 0;
            }
            try
            {
                if (src.Data[index] is LSL_Integer)
                    return (LSL_Integer)src.Data[index];
                if (src.Data[index] is LSL_Float)
                    return Convert.ToInt32(((LSL_Float)src.Data[index]).value);
                return new LSL_Integer(src.Data[index].ToString());
            }
            catch (FormatException)
            {
                return 0;
            }
            catch (InvalidCastException)
            {
                return 0;
            }
        }
LSL_Api