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