/// <summary>
 /// 切り取り
 /// </summary>
 /// <param name="r"></param>
 /// <param name="rMap"></param>
 /// <param name="nCatFlg"></param>
 public void Cat(RangeSquareTiles r, SquareTilesMap rMap, int nCatFlg)
 {
     m_objRMapchip.Set(r);
     m_objRMapchip.Decision();
     m_catFlg    = nCatFlg;
     m_aaMapChip = rMap.GetCat(m_objRMapchip);
 }
        /// <summary>
        /// タイル群をペーストする
        /// </summary>
        /// <param name="x"></param>
        /// <param name="y"></param>
        /// <param name="r"></param>
        /// <param name="rAA"></param>
        /// <param name="rMap"></param>
        /// <param name="catFlg"></param>
        /// <param name="pasteFlg"></param>
        public void PasteTiles(int x, int y, RangeSquareTiles r, D2ArrayObject <FSquareTileInfoMap> rAA, SquareTilesMap rMap, int catFlg, int pasteFlg)
        {
            FSquareTileInfoMap rMIM0 = null, rMIM1 = null;
            int i, j, k, l, nX, nY;

            nX = x + r.widthBlock;
            nY = y + r.hightBlock;
            nX = nX > m_tileCountX ? m_tileCountX : nX;
            nY = nY > m_tileCountY ? m_tileCountY : nY;

            for (i = y, k = 0; i < nY; ++i, ++k)
            {
                for (j = x, l = 0; j < nX; ++j, ++l)
                {
                    rMIM0 = m_mapTiles[i, j];
                    rMIM1 = rAA[k, l];
                    if (catFlg == CatAndPasteSquareTiles.TARGET_LAYER_ALL)
                    {
                        rMIM0.L00._n = rMIM1.L00._n;
                        rMIM0.L01._n = rMIM1.L01._n;
                    }
                    else if (catFlg == CatAndPasteSquareTiles.TARGET_LAYER00)
                    {
                        if (pasteFlg == CatAndPasteSquareTiles.TARGET_LAYER00)
                        {
                            rMIM0.L00._n = rMIM1.L00._n;
                        }
                        else if (pasteFlg == CatAndPasteSquareTiles.TARGET_LAYER01)
                        {
                            rMIM0.L01._n = rMIM1.L00._n;
                        }
                    }
                    else if (catFlg == CatAndPasteSquareTiles.TARGET_LAYER01)
                    {
                        if (pasteFlg == CatAndPasteSquareTiles.TARGET_LAYER00)
                        {
                            rMIM0.L00._n = rMIM1.L01._n;
                        }
                        else if (pasteFlg == CatAndPasteSquareTiles.TARGET_LAYER01)
                        {
                            rMIM0.L01._n = rMIM1.L01._n;
                        }
                    }
                }
            }
        }
        public D2ArrayObject <FSquareTileInfoMap> GetCat(RangeSquareTiles r)
        {
            D2ArrayObject <FSquareTileInfoMap> ret = new D2ArrayObject <FSquareTileInfoMap>(r.widthBlock, r.hightBlock);
            FSquareTileInfoMap rMIM0 = null, rMIM1 = null;
            int i, j, k, l, nX, nY;

            nX = r.startPosBlockX + r.widthBlock;
            nY = r.startPosBlockY + r.hightBlock;

            for (i = r.startPosBlockY, k = 0; i < nY; ++i, ++k)
            {
                for (j = r.startPosBlockX, l = 0; j < nX; ++j, ++l)
                {
                    rMIM0        = ret[k, l];
                    rMIM1        = m_mapTiles[i, j];
                    rMIM0.L00._n = rMIM1.L00._n;
                    rMIM0.L01._n = rMIM1.L01._n;
                }
            }

            return(ret);
        }