コード例 #1
0
 public override void Do()
 {
     if (m_replace)
     {
         m_currentTileSelection.Clear();
     }
     m_currentTileSelection.Merge(m_newTileSelection);
 }
コード例 #2
0
ファイル: EditPasteCommand.cs プロジェクト: xingchen1106/tIDE
        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();
            }
        }
コード例 #3
0
ファイル: TileBrush.cs プロジェクト: wang1986one/tIDE
 internal void GenerateSelection(Location brushLocation,
                                 TileSelection tileSelection)
 {
     tileSelection.Clear();
     foreach (TileBrushElement tileBrushElement in m_tileBrushElements)
     {
         tileSelection.AddLocation(brushLocation + tileBrushElement.Location);
     }
 }
コード例 #4
0
        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;
            }
        }
コード例 #5
0
ファイル: TileBrush.cs プロジェクト: wang1986one/tIDE
        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);
            }
        }
コード例 #6
0
ファイル: TileBrush.cs プロジェクト: dekk7/xEngine
 internal void GenerateSelection(Location brushLocation,
     TileSelection tileSelection)
 {
     tileSelection.Clear();
     foreach (TileBrushElement tileBrushElement in m_tileBrushElements)
         tileSelection.AddLocation(brushLocation + tileBrushElement.Location);
 }
コード例 #7
0
ファイル: TileBrush.cs プロジェクト: dekk7/xEngine
        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);
            }
        }