示例#1
0
        /// <summary>Creates a deep copy of the object, reusing the given object.</summary>
        /// <param name="into">The object to copy into.</param>
        /// <returns>The copy.</returns>
        public void CopyInto(SpatialHashedQuadTree <T> into)
        {
            Copyable.CopyInto(this, into);

            into._cells.Clear();
            foreach (var entry in _cells)
            {
                var treeCopy = entry.Value.NewInstance();
                entry.Value.CopyInto(treeCopy);
                into._cells.Add(entry.Key, treeCopy);
            }

            into._entryBounds.Clear();
            foreach (var bound in _entryBounds)
            {
                into._entryBounds.Add(bound.Key, bound.Value);
            }
        }
示例#2
0
        /// <summary>
        ///     Creates a deep copy of the system. The passed system must be of the same type.
        ///     <para>
        ///         This clones any contained data types to return an instance that represents a complete copy of the one passed
        ///         in.
        ///     </para>
        /// </summary>
        /// <param name="into">The instance to copy into.</param>
        /// <remarks>The manager for the system to copy into must be set to the manager into which the system is being copied.</remarks>
        public virtual void CopyInto(AbstractSystem into)
        {
            // Don't allow identity copying.
            Debug.Assert(into != this, "Cannot copy into self, is this intentional?");
            if (into == this)
            {
                return;
            }

            // Manager must be re-set to new owner before copying.
            if (into.Manager == null)
            {
                throw new ArgumentException("Target must have a Manager.", "into");
            }

            // Systems should never have to be copied inside the same context.
            if (into.Manager == Manager)
            {
                throw new ArgumentException("Target must have a different Manager.", "into");
            }

            // Use dynamic function to do basic copying.
            Copyable.CopyInto(this, into);
        }
示例#3
0
 /// <summary>Creates a deep copy of the object, reusing the given object.</summary>
 /// <param name="into">The object to copy into.</param>
 /// <returns>The copy.</returns>
 public void CopyInto(JointEdge into)
 {
     Copyable.CopyInto(this, into);
 }
示例#4
0
 /// <summary>Creates a deep copy of the object, reusing the given object.</summary>
 /// <param name="into">The object to copy into.</param>
 /// <returns>The copy.</returns>
 public virtual void CopyInto(Behavior into)
 {
     Copyable.CopyInto(this, into);
 }
示例#5
0
 /// <summary>Creates a deep copy of the object, reusing the given object.</summary>
 /// <param name="into">The object to copy into.</param>
 /// <returns>The copy.</returns>
 public virtual void CopyInto(Component into)
 {
     Copyable.CopyInto(this, into);
 }
示例#6
0
 /// <summary>Creates a deep copy of the object, reusing the given object.</summary>
 /// <param name="into">The object to copy into.</param>
 /// <returns>The copy.</returns>
 public void CopyInto(MersenneTwister into)
 {
     Copyable.CopyInto(this, into);
 }
示例#7
0
 /// <summary>Creates a deep copy of the object, reusing the given object.</summary>
 /// <param name="into">The object to copy into.</param>
 /// <returns>The copy.</returns>
 public void CopyInto(AttributeModifier <TAttribute> into)
 {
     Copyable.CopyInto(this, into);
 }
示例#8
0
 /// <summary>Creates a deep copy of the object, reusing the given object.</summary>
 /// <param name="into">The object to copy into.</param>
 /// <returns>The copy.</returns>
 public void CopyInto(ContactEdge into)
 {
     Copyable.CopyInto(this, into);
 }
示例#9
0
 /// <summary>Creates a deep copy of the object, reusing the given object.</summary>
 /// <param name="into">The object to copy into.</param>
 /// <returns>The copy.</returns>
 public void CopyInto(AIConfiguration into)
 {
     Copyable.CopyInto(this, into);
 }