Inheritance: ICollection, IList, IEnumerable, ICloneable
Beispiel #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));
 }
Beispiel #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));
        }
Beispiel #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);
        }
        /// <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);
        }
Beispiel #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);
        }
 /// <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;
 }
        /// <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;
        }
        /// <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;
        }
 /// <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);
 }
 /// <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);
 }
Beispiel #11
0
 public override int AddRange(Vector3List x)
 {
     lock (this.m_root)
         return(this.m_collection.AddRange(x));
 }
        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);
        }
 internal ReadOnlyVector3List(Vector3List list)
     : base(Tag.Default) {
     this.m_collection = list;
 }
Beispiel #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;
        }
 internal SyncVector3List(Vector3List list)
     : base(Tag.Default) {
     this.m_root = list.SyncRoot;
     this.m_collection = list;
 }
Beispiel #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;
        }
Beispiel #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);
 }
Beispiel #18
0
 internal ReadOnlyVector3List(Vector3List list)
     : base(Tag.Default)
 {
     this.m_collection = list;
 }
Beispiel #19
0
 public override int AddRange(Vector3List x)
 {
     throw new NotSupportedException("This is a Read Only Collection and can not be modified");
 }
 public override int AddRange(Vector3List x) {
     lock (this.m_root)
         return this.m_collection.AddRange(x);
 }
Beispiel #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;
 }
 public override int AddRange(Vector3List x) {
     throw new NotSupportedException("This is a Read Only Collection and can not be modified");
 }
Beispiel #23
0
 internal SyncVector3List(Vector3List list)
     : base(Tag.Default)
 {
     this.m_root       = list.SyncRoot;
     this.m_collection = list;
 }