summaryrefslogtreecommitdiff
path: root/Plugins/MonoGame.Extended/source/MonoGame.Extended.Tiled/Serialization/TiledMapContent.cs
diff options
context:
space:
mode:
authorchai <215380520@qq.com>2024-06-03 10:15:45 +0800
committerchai <215380520@qq.com>2024-06-03 10:15:45 +0800
commitacea7b2e728787a0d83bbf83c8c1f042d2c32e7e (patch)
tree0bfec05c1ca2d71be2c337bcd110a0421f19318b /Plugins/MonoGame.Extended/source/MonoGame.Extended.Tiled/Serialization/TiledMapContent.cs
parent88febcb02bf127d961c6471d9e846c0e1315f5c3 (diff)
+ plugins project
Diffstat (limited to 'Plugins/MonoGame.Extended/source/MonoGame.Extended.Tiled/Serialization/TiledMapContent.cs')
-rw-r--r--Plugins/MonoGame.Extended/source/MonoGame.Extended.Tiled/Serialization/TiledMapContent.cs75
1 files changed, 75 insertions, 0 deletions
diff --git a/Plugins/MonoGame.Extended/source/MonoGame.Extended.Tiled/Serialization/TiledMapContent.cs b/Plugins/MonoGame.Extended/source/MonoGame.Extended.Tiled/Serialization/TiledMapContent.cs
new file mode 100644
index 0000000..30ecbfd
--- /dev/null
+++ b/Plugins/MonoGame.Extended/source/MonoGame.Extended.Tiled/Serialization/TiledMapContent.cs
@@ -0,0 +1,75 @@
+using System.Collections.Generic;
+using System.Xml.Serialization;
+
+namespace MonoGame.Extended.Tiled.Serialization
+{
+ [XmlRoot(ElementName = "map")]
+ public class TiledMapContent
+ {
+ public TiledMapContent()
+ {
+ Properties = new List<TiledMapPropertyContent>();
+ Tilesets = new List<TiledMapTilesetContent>();
+ Layers = new List<TiledMapLayerContent>();
+ }
+
+ [XmlIgnore]
+ public string Name { get; set; }
+
+ [XmlIgnore]
+ public string FilePath { get; set; }
+
+ // Deprecated as of Tiled 1.9.0 (replaced by "class" attribute)
+ [XmlAttribute(DataType = "string", AttributeName = "type")]
+ public string Type { get; set; }
+
+ [XmlAttribute(DataType = "string", AttributeName = "class")]
+ public string Class { get; set; }
+
+ [XmlAttribute(AttributeName = "version")]
+ public string Version { get; set; }
+
+ [XmlAttribute(AttributeName = "orientation")]
+ public TiledMapOrientationContent Orientation { get; set; }
+
+ [XmlAttribute(AttributeName = "renderorder")]
+ public TiledMapTileDrawOrderContent RenderOrder { get; set; }
+
+ [XmlAttribute(AttributeName = "backgroundcolor")]
+ public string BackgroundColor { get; set; }
+
+ [XmlAttribute(AttributeName = "width")]
+ public int Width { get; set; }
+
+ [XmlAttribute(AttributeName = "height")]
+ public int Height { get; set; }
+
+ [XmlAttribute(AttributeName = "tilewidth")]
+ public int TileWidth { get; set; }
+
+ [XmlAttribute(AttributeName = "tileheight")]
+ public int TileHeight { get; set; }
+
+ [XmlAttribute(AttributeName = "hexsidelength")]
+ public int HexSideLength { get; set; }
+
+ [XmlAttribute(AttributeName = "staggeraxis")]
+ public TiledMapStaggerAxisContent StaggerAxis { get; set; }
+
+ [XmlAttribute(AttributeName = "staggerindex")]
+ public TiledMapStaggerIndexContent StaggerIndex { get; set; }
+
+ [XmlElement(ElementName = "tileset")]
+ public List<TiledMapTilesetContent> Tilesets { get; set; }
+
+ [XmlElement(ElementName = "layer", Type = typeof(TiledMapTileLayerContent))]
+ [XmlElement(ElementName = "imagelayer", Type = typeof(TiledMapImageLayerContent))]
+ [XmlElement(ElementName = "objectgroup", Type = typeof(TiledMapObjectLayerContent))]
+ [XmlElement(ElementName = "group", Type = typeof(TiledMapGroupLayerContent))]
+ public List<TiledMapLayerContent> Layers { get; set; }
+
+ [XmlArray("properties")]
+ [XmlArrayItem("property")]
+ public List<TiledMapPropertyContent> Properties { get; set; }
+ }
+}