} //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
/// <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); } // Copy the borderValue as well BorderValue = source.BorderValue; }
/// <summary> /// Copy constructor /// @throw noise::ExceptionOutOfMemory Out of memory. /// </summary> /// <param name="copy">The map to copy</param> protected DataMap(DataMap <T> copy) { CopyFrom(copy); }
} //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