Пример #1
0
        public Map(Map mapCopy)
        {
            TileTypes = new BindingList<TileType>();

            foreach (TileType tileType in mapCopy.TileTypes)
            {
                TileTypes.Add(new TileType(tileType));
            }

            TilesetTexture = mapCopy.TilesetTexture;

            CustomLayer = new TileLayer(mapCopy.CustomLayer);
            TileLayers = new List<TileLayer>();

            foreach (TileLayer layer in mapCopy.TileLayers)
                TileLayers.Add(new TileLayer(layer));
        }
        public TileLayer(TileLayer layer)
        {
            tileset = layer.tileset;
            width = layer.width;
            height = layer.height;
            tileSize = layer.tileSize;
            tiles = new Tile[height, width];

            Array.Copy(layer.tiles, tiles, width * height);
        }