Exemplo n.º 1
0
        public void ReplaceTilesByTileIndex(int oldTileIndex, int newTileIndex, TileOrientation orientation)
        {
            if (oldTileIndex == newTileIndex)
            {
                return;
            }

            for (int row = 0; row < Height; row++)
            {
                for (int column = 0; column < Width; column++)
                {
                    if (_tiles[row, column].Index == oldTileIndex)
                    {
                        _tiles[row, column] = new TileMapEntry(newTileIndex, orientation);
                    }
                }
            }
        }
Exemplo n.º 2
0
        public void UpdateTileIndex(int oldTileIndex, int newTileIndex)
        {
            if (oldTileIndex == newTileIndex)
            {
                return;
            }

            for (int row = 0; row < Height; row++)
            {
                for (int column = 0; column < Width; column++)
                {
                    if (_tiles[row, column].Index == oldTileIndex)
                    {
                        var orientation = _tiles[row, column].Orientation;
                        _tiles[row, column] = new TileMapEntry(newTileIndex, orientation);
                    }
                }
            }
        }
Exemplo n.º 3
0
 public void PlaceTile(int row, int column, int tileIndex, TileOrientation orientation)
 {
     _tiles[row, column] = new TileMapEntry(tileIndex, orientation);
 }