internal TileBrush(string id, Layer layer, TileSelection tileSelection) { m_id = id; xTile.Dimensions.Rectangle selectionBounds = tileSelection.Bounds; m_brushSize = selectionBounds.Size; m_tileSize = layer.TileSize; m_displaySize = new xTile.Dimensions.Size( m_brushSize.Width * m_tileSize.Width, m_brushSize.Height * m_tileSize.Height); m_tileBrushElements = new List <TileBrushElement>(); foreach (Location location in tileSelection.Locations) { if (!layer.IsValidTileLocation(location)) { continue; } Tile tile = layer.Tiles[location]; Tile tileClone = tile == null ? null : tile.Clone(layer); TileBrushElement tileBrushElement = new TileBrushElement( tileClone, location - selectionBounds.Location); m_tileBrushElements.Add(tileBrushElement); } }
internal TileBrush(string id, Layer layer, TileSelection tileSelection) { m_id = id; xTile.Dimensions.Rectangle selectionBounds = tileSelection.Bounds; m_brushSize = selectionBounds.Size; m_tileSize = layer.TileSize; m_displaySize = new xTile.Dimensions.Size( m_brushSize.Width * m_tileSize.Width, m_brushSize.Height * m_tileSize.Height); m_tileBrushElements = new List<TileBrushElement>(); foreach (Location location in tileSelection.Locations) { if (!layer.IsValidTileLocation(location)) continue; Tile tile = layer.Tiles[location]; Tile tileClone = tile == null ? null : tile.Clone(layer); TileBrushElement tileBrushElement = new TileBrushElement( tileClone, location - selectionBounds.Location); m_tileBrushElements.Add(tileBrushElement); } }