Beispiel #1
0
        // 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);
                }
            }
        }
Beispiel #2
0
        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);
                }
            }
        }
Beispiel #3
0
 public void SetTile(int x, int y, int tileIndex, int tileSetIndex)
 {
     Layer[y * Width + x] = new Tile(tileIndex, tileSetIndex);
 }
Beispiel #4
0
 public void SetTile(int x, int y, Tile tile)
 {
     Layer[y * Width + x] = tile;
 }