// Fills the map with a tile from a tileset public MapLayerData(string mapLayerName, int width, int height, int tileIndex, int tileSet) : this(mapLayerName, width, height) { Tile tile = new Tile(tileIndex, tileSet); for (int y = 0; y < Height; y++) { for (int x = 0; x < Width; x++) { SetTile(x, y, tile); } } }
public MapLayerData(string mapLayerName, int width, int height, int tileIndex, int tileSet) { MapLayerName = mapLayerName; Width = width; Height = height; Layer = new Tile[height * width]; Tile tile = new Tile(tileIndex, tileSet); for (int y = 0; y < height; y++) { for (int x = 0; x < width; x++) { SetTile(x, y, tile); } } }
public void SetTile(int x, int y, int tileIndex, int tileSetIndex) { Layer[y * Width + x] = new Tile(tileIndex, tileSetIndex); }
public void SetTile(int x, int y, Tile tile) { Layer[y * Width + x] = tile; }