OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs
/// <summary>
/// Obtain float from an index.
/// </summary>
/// <remarks>
/// For cases where implicit conversions would apply if items
/// were not in a list (e.g. integer to float, but not float
/// to integer) functions check for alternate types so as to
/// down-cast from Object to the correct type.
/// Note: no checks for item index being valid are performed
/// </remarks>
/// <returns></returns>
/// <param name='itemIndex'></param>
Obtain float from an index.
Obtain float from an index .
public LSL_Types.LSLFloat GetLSLFloatItem(int itemIndex)
            {
                if (m_data[itemIndex] is LSL_Types.LSLInteger)
                {
                    return (LSL_Types.LSLInteger)m_data[itemIndex];
                }
                else if (m_data[itemIndex] is Int32)
                {
                    return new LSL_Types.LSLFloat((int)m_data[itemIndex]);
                }
                else if (m_data[itemIndex] is float)
                {
                    return new LSL_Types.LSLFloat((float)m_data[itemIndex]);
                }
                else if (m_data[itemIndex] is Double)
                {
                    return new LSL_Types.LSLFloat((Double)m_data[itemIndex]);
                }
                else if (m_data[itemIndex] is LSL_Types.LSLString)
                {
                    return new LSL_Types.LSLFloat(m_data[itemIndex].ToString());
                }
                else
                {
                    return (LSL_Types.LSLFloat)m_data[itemIndex];
                }
            }
public LSL_Types . LSLFloat GetLSLFloatItem ( int itemIndex ) { if ( m_data [ itemIndex ] is LSL_Types . LSLInteger ) { return ( LSL_Types . LSLInteger ) m_data [ itemIndex ] ; } else if ( m_data [ itemIndex ] is Int32 ) { return new LSL_Types . LSLFloat ( ( int ) m_data [ itemIndex ] ) ; } else if ( m_data [ itemIndex ] is float ) { return new LSL_Types . LSLFloat ( ( float ) m_data [ itemIndex ] ) ; } else if ( m_data [ itemIndex ] is Double ) { return new LSL_Types . LSLFloat ( ( Double ) m_data [ itemIndex ] ) ; } else if ( m_data [ itemIndex ] is LSL_Types . LSLString ) { return new LSL_Types . LSLFloat ( m_data [ itemIndex ] . ToString ( ) ) ; } else { return ( LSL_Types . LSLFloat ) m_data [ itemIndex ] ; } }
Obtain float from an index.
Obtain float from an index .
None
itemIndex
int
None
remarks
For cases where implicit conversions would apply if items
were not in a list  functions check for alternate types so as to
down-cast from Object to the correct type.
Note: no checks for item index being valid are performed
For cases where implicit conversions would apply if items were not in a list functions check for alternate types so as to down - cast from Object to the correct type . Note : no checks for item index being valid are performed