public override void Do()
 {
     if (m_replace)
     {
         m_currentTileSelection.Clear();
     }
     m_currentTileSelection.Merge(m_newTileSelection);
 }
Example #2
0
        public override void Do()
        {
            TileSelection tileSelection = new TileSelection();

            m_tileBrush.GenerateSelection(m_brushLocation, tileSelection);
            m_oldTiles = new TileBrush(m_layer, tileSelection);

            m_tileBrush.ApplyTo(m_layer, m_brushLocation, m_tileSelection);
            if (!m_fromClipboard)
            {
                m_tileSelection.Clear();
            }
        }
Example #3
0
 internal void GenerateSelection(Location brushLocation,
                                 TileSelection tileSelection)
 {
     tileSelection.Clear();
     foreach (TileBrushElement tileBrushElement in m_tileBrushElements)
     {
         tileSelection.AddLocation(brushLocation + tileBrushElement.Location);
     }
 }
        public override void Do()
        {
            Rectangle selectionContext
                = new Rectangle(Location.Origin, m_layer.LayerSize);

            switch (m_changeSelectionType)
            {
            case ChangeSelectionType.SelectAll:
                m_currentTileSelection.SelectAll(selectionContext);
                break;

            case ChangeSelectionType.Clear:
                m_currentTileSelection.Clear();
                break;

            case ChangeSelectionType.Invert:
                m_currentTileSelection.Invert(selectionContext);
                break;
            }
        }
Example #5
0
        internal void ApplyTo(Layer layer, Location brushLocation,
                              TileSelection tileSelection)
        {
            Map map = layer.Map;

            xTile.Dimensions.Size layerTileSize = layer.TileSize;

            if (layerTileSize != m_tileSize)
            {
                return;
            }


            tileSelection.Clear();
            foreach (TileBrushElement tileBrushElement in m_tileBrushElements)
            {
                Location tileLocation = brushLocation + tileBrushElement.Location;
                if (!layer.IsValidTileLocation(tileLocation))
                {
                    continue;
                }

                Tile tile      = tileBrushElement.Tile;
                Tile tileClone = null;
                if (tile != null)
                {
                    TileSheet tileSheet = tile.TileSheet;

                    if (!map.TileSheets.Contains(tile.TileSheet))
                    {
                        continue;
                    }

                    tileClone = tile.Clone(layer);
                }

                layer.Tiles[tileLocation] = tileClone;
                tileSelection.AddLocation(tileLocation);
            }
        }
Example #6
0
 internal void GenerateSelection(Location brushLocation,
     TileSelection tileSelection)
 {
     tileSelection.Clear();
     foreach (TileBrushElement tileBrushElement in m_tileBrushElements)
         tileSelection.AddLocation(brushLocation + tileBrushElement.Location);
 }
Example #7
0
        internal void ApplyTo(Layer layer, Location brushLocation,
            TileSelection tileSelection)
        {
            Map map = layer.Map;
            xTile.Dimensions.Size layerTileSize = layer.TileSize;

            if (layerTileSize != m_tileSize)
                return;

            tileSelection.Clear();
            foreach (TileBrushElement tileBrushElement in m_tileBrushElements)
            {
                Location tileLocation = brushLocation + tileBrushElement.Location;
                if (!layer.IsValidTileLocation(tileLocation))
                    continue;

                Tile tile = tileBrushElement.Tile;
                Tile tileClone = null;
                if (tile != null)
                {
                    TileSheet tileSheet = tile.TileSheet;

                    if (!map.TileSheets.Contains(tile.TileSheet))
                        continue;

                    tileClone = tile.Clone(layer);
                }

                layer.Tiles[tileLocation] = tileClone;
                tileSelection.AddLocation(tileLocation);
            }
        }