Наследование: ICollection, IList, IEnumerable, ICloneable
Пример #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>
        public virtual object Clone()
        {
            var newColl = new Vector3List(this.m_count);

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

            return(newColl);
        }
Пример #4
0
        /// <summary>
        ///		Creates a shallow copy of the <see cref="Vector3List"/>.
        /// </summary>
        public virtual 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);
        }
Пример #5
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>
        public virtual int AddRange(Vector3List x)
        {
            if (this.m_count + x.Count >= this.m_array.Length)
            {
                EnsureCapacity(this.m_count + x.Count);
            }

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

            return(this.m_count);
        }
Пример #6
0
 /// <summary>
 ///		Initializes a new instance of the <c>Enumerator</c> class.
 /// </summary>
 /// <param name="tc"></param>
 internal Enumerator(Vector3List tc) {
     this.m_collection = tc;
     this.m_index = -1;
     this.m_version = tc.m_version;
 }
Пример #7
0
        /// <summary>
        ///		Creates a shallow copy of the <see cref="Vector3List"/>.
        /// </summary>
        public virtual object Clone() {
            var newColl = new Vector3List(this.m_count);
            Array.Copy(this.m_array, 0, newColl.m_array, 0, this.m_count);
            newColl.m_count = this.m_count;
            newColl.m_version = this.m_version;

            return newColl;
        }
Пример #8
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>
        public virtual int AddRange(Vector3List x) {
            if (this.m_count + x.Count >= this.m_array.Length) {
                EnsureCapacity(this.m_count + x.Count);
            }

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

            return this.m_count;
        }
Пример #9
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);
 }
Пример #10
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) {
     this.m_array = new Vector3[c.Count];
     AddRange(c);
 }
Пример #11
0
 public override int AddRange(Vector3List x)
 {
     lock (this.m_root)
         return(this.m_collection.AddRange(x));
 }
Пример #12
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);
        }
Пример #13
0
 internal ReadOnlyVector3List(Vector3List list)
     : base(Tag.Default) {
     this.m_collection = list;
 }
Пример #14
0
        /// <summary>
        ///		Creates a shallow copy of the <see cref="Vector3List"/>.
        /// </summary>
        public virtual 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;
        }
Пример #15
0
 internal SyncVector3List(Vector3List list)
     : base(Tag.Default) {
     this.m_root = list.SyncRoot;
     this.m_collection = list;
 }
Пример #16
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>
        public virtual 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;
        }
Пример #17
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)
 {
     this.m_array = new Vector3[c.Count];
     AddRange(c);
 }
Пример #18
0
 internal ReadOnlyVector3List(Vector3List list)
     : base(Tag.Default)
 {
     this.m_collection = list;
 }
Пример #19
0
 public override int AddRange(Vector3List x)
 {
     throw new NotSupportedException("This is a Read Only Collection and can not be modified");
 }
Пример #20
0
 public override int AddRange(Vector3List x) {
     lock (this.m_root)
         return this.m_collection.AddRange(x);
 }
Пример #21
0
 /// <summary>
 ///		Initializes a new instance of the <c>Enumerator</c> class.
 /// </summary>
 /// <param name="tc"></param>
 internal Enumerator(Vector3List tc)
 {
     this.m_collection = tc;
     this.m_index      = -1;
     this.m_version    = tc.m_version;
 }
Пример #22
0
 public override int AddRange(Vector3List x) {
     throw new NotSupportedException("This is a Read Only Collection and can not be modified");
 }
Пример #23
0
 internal SyncVector3List(Vector3List list)
     : base(Tag.Default)
 {
     this.m_root       = list.SyncRoot;
     this.m_collection = list;
 }