Beispiel #1
0
        public virtual void CopyTo(Sparse2DBlockDeflateArray <T> dst)
        {
            if (dst.mHeight != mHeight || dst.mWidth != mWidth)
            {
                throw new Exception("Error, cannot copy Sparse2DBlockDeflateArray to dest: Dest is not the same size");
            }

            for (int x = 0; x < mWidth; x++)
            {
                for (int y = 0; y < mHeight; y++)
                {
                    dst[x, y] = this[x, y];
                }
            }
        }
Beispiel #2
0
        public virtual Sparse2DBlockDeflateArray <T> Clone()
        {
            Sparse2DBlockDeflateArray <T> cpy = new Sparse2DBlockDeflateArray <T>(mWidth, mHeight, mEmptyValue, mEraseEmptyBlocksDynamically, mDeflateBlocksDynamically);

            //mIsBlockConstant.copyTo(cpy.mIsBlockConstant);
            //mBlockConstantValue.CopyTo(cpy.mBlockConstantValue);

            for (int x = 0; x < mWidth; x++)
            {
                for (int y = 0; y < mHeight; y++)
                {
                    cpy[x, y] = this[x, y];
                }
            }
            return(cpy);
        }