예제 #1
0
        public virtual Sparse2DBlockArray <T> Clone()
        {
            Sparse2DBlockArray <T> cpy = new Sparse2DBlockArray <T>(mWidth, mHeight, mEmptyValue, mEraseEmptyBlocksDynamically);

            for (int x = 0; x < mWidth; x++)
            {
                for (int y = 0; y < mHeight; y++)
                {
                    cpy[x, y] = this[x, y];
                }
            }
            return(cpy);
        }
예제 #2
0
        public virtual void CopyTo(Sparse2DBlockArray <T> dst)
        {
            if (dst.mHeight != mHeight || dst.mWidth != mWidth)
            {
                throw new Exception("Error, cannot copy Sparse2DBlockArray 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];
                }
            }
        }