Ejemplo n.º 1
0
        public void AddTile(Tile tile, int x, int y)
        {
            TileBrushCell cell = new TileBrushCell {
                x = x, y = y, tile = tile
            };

            cells[x][y] = cell;
            CellSize    = (int)tile.Width;
        }
Ejemplo n.º 2
0
        public void Reset(int width, int height)
        {
            TileBrushCell[][] newcells = new TileBrushCell[width][];
            for (int i = 0; i < width; i++)
            {
                newcells[i] = new TileBrushCell[height];
                if (cells != null && i < Width) // old width
                {
                    for (int j = 0; j < height; j++)
                    {
                        if (j < Height)
                        {
                            newcells[i][j] = new TileBrushCell(i, j, cells[i][j].tile);
                        }
                    }
                }
            }

            cells  = newcells;
            Height = height;
            Width  = width;
        }
Ejemplo n.º 3
0
        public void Reset(int width, int height)
        {
            TileBrushCell[][] newcells = new TileBrushCell[width][];
            for (int i = 0; i < width; i++)
            {
                newcells[i] = new TileBrushCell[height];
                if (cells != null && i < Width) // old width
                {
                    for (int j = 0; j < height; j++)
                    {
                        if (j < Height) newcells[i][j] = new TileBrushCell(i, j, cells[i][j].tile);
                    }
                }
            }

            cells = newcells;
            Height = height;
            Width = width;
        }
Ejemplo n.º 4
0
 public void AddTile(Tile tile, int x, int y)
 {
     TileBrushCell cell = new TileBrushCell {x = x, y = y, tile = tile};
     cells[x][y] = cell;
     CellSize = (int)tile.Width;
 }