Пример #1
0
        /// <summary>
        /// Parse and read an annotation position object
        /// </summary>
        /// <param name="pos">The log annotation position to read</param>
        /// <returns>Possible errors occured during the parsing</returns>
        public LogAnnotParseError ParseAnnotationPosition(LogAnnotationPosition pos)
        {
            //Check the parent
            if (pos.LogAnnotation != this)
            {
                return(LogAnnotParseError.INVALID_PARENT);
            }

            //Check if we find the headers or not
            List <Int32> idx = pos.Headers;

            foreach (Int32 it in idx)
            {
                if (it != -1 && m_assignedHeaders.BinarySearch(it) >= 0)
                {
                    return(LogAnnotParseError.ERROR_HEADER_ALREADY_PRESENT);
                }
            }

            m_positions.Add(pos, new List <Vector3>(pos)); //Parse the positions and store the values once and for all

            //Set the headers as already assigned
            foreach (Int32 it in idx)
            {
                if (it != -1)
                {
                    int p = ~m_assignedHeaders.BinarySearch(it);
                    m_assignedHeaders.Insert(p, it);
                }
            }
            pos.AddListener(this);

            return(LogAnnotParseError.NO_ERROR);
        }