コード例 #1
0
 public UndoMapTileRemove(MapEditor Editor, MapProject Project, int TileIndex)
 {
     _MapEditor   = Editor;
     _TileIndex   = TileIndex;
     _MapProject  = Project;
     _RemovedTile = _MapProject.Tiles[TileIndex];
 }
コード例 #2
0
        public UndoMapTileModified(MapEditor Editor, MapProject Project, int TileIndex)
        {
            this.TileIndex = TileIndex;
            this.Project   = Project;
            MapEditor      = Editor;


            var Tile = Project.Tiles[TileIndex];

            this.Tile       = new MapProject.Tile();
            this.Tile.Chars = new GR.Game.Layer <MapProject.TileChar>();
            this.Tile.Chars.Resize(Tile.Chars.Width, Tile.Chars.Height);
            for (int i = 0; i < Tile.Chars.Width; ++i)
            {
                for (int j = 0; j < Tile.Chars.Height; ++j)
                {
                    this.Tile.Chars[i, j]           = new MapProject.TileChar();
                    this.Tile.Chars[i, j].Character = Tile.Chars[i, j].Character;
                    this.Tile.Chars[i, j].Color     = Tile.Chars[i, j].Color;
                }
            }

            this.Tile.Name = Tile.Name;
        }