예제 #1
0
 /// <summary>
 ///		Creates a read-only wrapper for a
 ///     <c>Vector3List</c> instance.
 /// </summary>
 /// <returns>
 ///     An <c>Vector3List</c> wrapper that is read-only.
 /// </returns>
 public static Vector3List ReadOnly(Vector3List list)
 {
     if (list == null)
     {
         throw new ArgumentNullException("list");
     }
     return(new ReadOnlyVector3List(list));
 }
예제 #2
0
        private int m_version;                 // defaults to 0

        #endregion

        #region Static Wrappers

        /// <summary>
        ///		Creates a synchronized (thread-safe) wrapper for a
        ///     <c>Vector3List</c> instance.
        /// </summary>
        /// <returns>
        ///     An <c>Vector3List</c> wrapper that is synchronized (thread-safe).
        /// </returns>
        public static Vector3List Synchronized(Vector3List list)
        {
            if (list == null)
            {
                throw new ArgumentNullException("list");
            }
            return(new SyncVector3List(list));
        }
예제 #3
0
        /// <summary>
        ///		Creates a shallow copy of the <see cref="Vector3List"/>.
        /// </summary>
        virtual public object Clone()
        {
            Vector3List newColl = new Vector3List(m_count);

            Array.Copy(m_array, 0, newColl.m_array, 0, m_count);
            newColl.m_count   = m_count;
            newColl.m_version = m_version;

            return(newColl);
        }
예제 #4
0
        /// <summary>
        ///		Adds the elements of another <c>Vector3List</c> to the current <c>Vector3List</c>.
        /// </summary>
        /// <param name="x">The <c>Vector3List</c> whose elements should be added to the end of the current <c>Vector3List</c>.</param>
        /// <returns>The new <see cref="Vector3List.Count"/> of the <c>Vector3List</c>.</returns>
        virtual public int AddRange(Vector3List x)
        {
            if (m_count + x.Count >= m_array.Length)
            {
                EnsureCapacity(m_count + x.Count);
            }

            Array.Copy(x.m_array, 0, m_array, m_count, x.Count);
            m_count += x.Count;
            m_version++;

            return(m_count);
        }
예제 #5
0
 internal ReadOnlyVector3List(Vector3List list)
     : base(Tag.Default)
 {
     m_collection = list;
 }
예제 #6
0
 public override int AddRange(Vector3List x)
 {
     lock (this.m_root) return(m_collection.AddRange(x));
 }
예제 #7
0
 internal SyncVector3List(Vector3List list)
     : base(Tag.Default)
 {
     m_root       = list.SyncRoot;
     m_collection = list;
 }
예제 #8
0
 /// <summary>
 ///		Initializes a new instance of the <c>Enumerator</c> class.
 /// </summary>
 /// <param name="tc"></param>
 internal Enumerator(Vector3List tc)
 {
     m_collection = tc;
     m_index      = -1;
     m_version    = tc.m_version;
 }
예제 #9
0
 /// <summary>
 ///		Initializes a new instance of the <c>Vector3List</c> class
 ///		that contains elements copied from the specified <c>Vector3List</c>.
 /// </summary>
 /// <param name="c">The <c>Vector3List</c> whose elements are copied to the new collection.</param>
 public Vector3List(Vector3List c)
 {
     m_array = new Vector3[c.Count];
     AddRange(c);
 }
예제 #10
0
 public override int AddRange(Vector3List x)
 {
     throw new NotSupportedException("This is a Read Only Collection and can not be modified");
 }