Пример #1
0
        public TileSelection(TileSelection selection)
        {
            if (selection != null) {
                _offset = selection._offset;

                _tileAnnot = new MultiTileSelectionAnnot(selection._tileAnnot);

                _active = selection._active;
                _floating = selection._floating;

                _tiles = new Dictionary<TileCoord, TileStack>();
                foreach (KeyValuePair<TileCoord, TileStack> kvp in selection._tiles)
                    _tiles.Add(kvp.Key, new TileStack(kvp.Value));
            }
        }
        public TileSelection GetAsTileSelection(Project project, int tileWidth, int tileHeight)
        {
            Dictionary<TileCoord, TileStack> xlat = new Dictionary<TileCoord, TileStack>();
            foreach (KeyValuePair<TileCoord, Guid[]> item in _tiles) {
                TileStack stack = new TileStack();

                foreach (Guid tileId in item.Value) {
                    TilePool pool = project.TilePoolManager.PoolFromItemKey(tileId);
                    Tile tile = pool.GetTile(tileId);
                    stack.Add(tile);
                }

                xlat.Add(item.Key, stack);
            }

            TileSelection selection = new TileSelection(tileWidth, tileHeight);
            selection.AddTiles(xlat);

            return selection;
        }
Пример #3
0
 public PasteFloatingSelectionCommand(ITileSelectionLayer selectLayer, TileSelection selection, TileCoord centerOffset)
 {
     _selectLayer = selectLayer;
     _selection = selection;
     _centerOffset = centerOffset;
 }
Пример #4
0
        public override void Execute()
        {
            _selection = new TileSelection(_selectLayer.TileSelection);

            _selectLayer.DeleteTileSelection();
        }