Ejemplo n.º 1
0
        public Layer[] GetMapLayers()
        {
            var mapLayer = xrootElement.Elements("layer");

            Layer[] layer = new Layer[mapLayer.Count()];
            int     key   = 0;

            foreach (var VARIABLE in mapLayer)
            {
                layer[key].name   = VARIABLE.Attribute("name").Value;
                layer[key].width  = int.Parse(VARIABLE.Attribute("width").Value);
                layer[key].height = int.Parse(VARIABLE.Attribute("height").Value);
                layer[key].data   = VARIABLE.Element("data").Value.Split(',');
                key++;
            }

            return(layer);
        }
Ejemplo n.º 2
0
        public Tileset[] GetTileset()
        {
            var xmlTilesets = xrootElement.Elements("tileset");

            Tileset[] tileset = new Tileset[xmlTilesets.Count()];
            int       key     = 0;

            foreach (var VARIABLE in xmlTilesets)
            {
                tileset[key].name       = VARIABLE.Attribute("name").Value;
                tileset[key].firstgid   = int.Parse(VARIABLE.Attribute("firstgid").Value);
                tileset[key].tilecount  = int.Parse(VARIABLE.Attribute("tilecount").Value);
                tileset[key].columns    = int.Parse(VARIABLE.Attribute("columns").Value);
                tileset[key].tilewidth  = int.Parse(VARIABLE.Attribute("tilewidth").Value);
                tileset[key].tileheight = int.Parse(VARIABLE.Attribute("tileheight").Value);
                key++;
            }

            return(tileset);
        }