Files
MonoGame.Extended/source/MonoGame.Extended.Tiled/Serialization/TiledMapPropertyContent.cs
T
2024-05-18 19:59:41 -04:00

29 lines
727 B
C#

using System.Collections.Generic;
using System.Xml.Serialization;
namespace MonoGame.Extended.Tiled.Serialization
{
public class TiledMapPropertyContent
{
[XmlAttribute(AttributeName = "name")]
public string Name { get; set; }
[XmlAttribute(AttributeName = "value")]
public string ValueAttribute { get; set; }
[XmlText]
public string ValueBody { get; set; }
[XmlArray("properties")]
[XmlArrayItem("property")]
public List<TiledMapPropertyContent> Properties { get; set; }
public string Value => ValueAttribute ?? ValueBody;
public override string ToString()
{
return $"{Name}: {Value}";
}
}
}