Exemplo n.º 1
0
        public TiledLayer(XElement elem)
            : base(elem)
        {
            Name   = elem.Value <string>("@name");
            Width  = elem.Value <int>("@width");
            Height = elem.Value <int>("@height");
            Hidden = (elem.Value <int?>("@visible") ?? 1) == 0;
            XElement xelement;

            Properties = (xelement = elem.Element("properties")) != null?xelement.Elements("property").Select(prop => new TiledProperty(prop)).ToList() : null;

            Data = new TiledLayerData(elem.Element("data"));
        }
Exemplo n.º 2
0
        public TiledLayer(XElement elem)
            : base(elem)
        {
            Name         = elem.Value <string>("@name");
            Width        = elem.Value <int>("@width");
            Height       = elem.Value <int>("@height");
            Hidden       = (elem.Value <int?>("@visible") ?? 1) == 0;
            Transparency = elem.Value <float?>("@opacity") ?? 1;
            Horizontal   = elem.Value <float?>("@offsetx") ?? 0;
            Vertical     = elem.Value <float?>("@offsety") ?? 0;
            XElement xelement;

            Properties = (xelement = elem.Element("properties")) != null?xelement.Elements("property").Select(prop => new TiledProperty(prop)).ToList() : null;

            Data = new TiledLayerData(elem.Element("data"));
        }