Пример #1
0
        }        //end Copy

        /// <summary>
        /// Copies up to width * height cells from internal data buffer into the data buffer of the given map
        /// This method use dest.CopyFrom(DataMap<T> source) where sours is the current object.
        /// </summary>
        /// <param name="dest">The destination map</param>
        public void CopyTo(DataMap <T> dest)
        {
            if (dest == null)
            {
                throw new ArgumentNullException("Dest is null");
            }            //end if
            else
            {
                dest.CopyFrom(this);
            }    //end elseif
        }        //end Copy
Пример #2
0
        }        //end SetSize

        /// <summary>
        /// Copies the contents of the buffer in the source map into
        /// this map, considering source is a trusted source
        /// </summary>
        /// <param name="source">The source map</param>
        public void CopyFrom(DataMap <T> source)
        {
            AllocateBuffer(source._width, source._height);

            if (_cellsCount > 0)
            {
                Array.Copy(source._data, 0, _data, 0, _cellsCount);
            }            //end if

            // Copy the borderValue as well
            _borderValue = source._borderValue;
        }        //end Copy
Пример #3
0
        }        //End NoiseMap

        /// <summary>
        /// Copy constructor
        /// @throw noise::ExceptionOutOfMemory Out of memory.
        /// </summary>
        /// <param name="copy">The map to copy</param>
        public DataMap(DataMap <T> copy)
        {
            CopyFrom(copy);
        }        //End NoiseMap