示例#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);
                    }
                }
            }
        }
示例#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);
                    }
                }
            }
        }
示例#3
0
 public void PlaceTile(int row, int column, int tileIndex, TileOrientation orientation)
 {
     _tiles[row, column] = new TileMapEntry(tileIndex, orientation);
 }