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

llList2Key() public method

public llList2Key ( OpenSim.Region.ScriptEngine.Shared.LSL_Types.list src, int index ) : OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLString
src OpenSim.Region.ScriptEngine.Shared.LSL_Types.list
index int
return OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLString
        public LSL_Key llList2Key(LSL_List src, int index)
        {
            m_host.AddScriptLPS(1);
            if (index < 0)
            {
                index = src.Length + index;
            }

            if (index >= src.Length || index < 0)
            {
                return "";
            }

            // SL spits out an empty string for types other than key & string
            // At the time of patching, LSL_Key is currently LSL_String,
            // so the OR check may be a little redundant, but it's being done
            // for completion and should LSL_Key ever be implemented
            // as it's own struct
            // NOTE: 3rd case is needed because a NULL_KEY comes through as
            // type 'obj' and wrongly returns ""
            else if (!(src.Data[index] is LSL_String ||
                       src.Data[index] is LSL_Key ||
                       src.Data[index].ToString() == "00000000-0000-0000-0000-000000000000"))
            {
                return "";
            }

            return src.Data[index].ToString();
        }
LSL_Api