summaryrefslogtreecommitdiff
path: root/Plugins/MonoGame.Extended/source/MonoGame.Extended.Tiled/Serialization/TiledMapLayerContent.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/TiledMapLayerContent.cs
parent88febcb02bf127d961c6471d9e846c0e1315f5c3 (diff)
+ plugins project
Diffstat (limited to 'Plugins/MonoGame.Extended/source/MonoGame.Extended.Tiled/Serialization/TiledMapLayerContent.cs')
-rw-r--r--Plugins/MonoGame.Extended/source/MonoGame.Extended.Tiled/Serialization/TiledMapLayerContent.cs61
1 files changed, 61 insertions, 0 deletions
diff --git a/Plugins/MonoGame.Extended/source/MonoGame.Extended.Tiled/Serialization/TiledMapLayerContent.cs b/Plugins/MonoGame.Extended/source/MonoGame.Extended.Tiled/Serialization/TiledMapLayerContent.cs
new file mode 100644
index 0000000..01d8a9d
--- /dev/null
+++ b/Plugins/MonoGame.Extended/source/MonoGame.Extended.Tiled/Serialization/TiledMapLayerContent.cs
@@ -0,0 +1,61 @@
+using System.Collections.Generic;
+using System.Xml.Serialization;
+
+namespace MonoGame.Extended.Tiled.Serialization
+{
+ [XmlInclude(typeof(TiledMapTileLayerContent))]
+ [XmlInclude(typeof(TiledMapImageLayerContent))]
+ [XmlInclude(typeof(TiledMapObjectLayerContent))]
+ public abstract class TiledMapLayerContent
+ {
+ protected TiledMapLayerContent(TiledMapLayerType layerType)
+ {
+ LayerType = layerType;
+ Opacity = 1.0f;
+ ParallaxX = 1.0f;
+ ParallaxY = 1.0f;
+ Visible = true;
+ Properties = new List<TiledMapPropertyContent>();
+ }
+
+ [XmlAttribute(AttributeName = "name")]
+ public string Name { 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 = "opacity")]
+ public float Opacity { get; set; }
+
+ [XmlAttribute(AttributeName = "visible")]
+ public bool Visible { get; set; }
+
+ [XmlAttribute(AttributeName = "offsetx")]
+ public float OffsetX { get; set; }
+
+ [XmlAttribute(AttributeName = "offsety")]
+ public float OffsetY { get; set; }
+
+ [XmlAttribute(AttributeName = "parallaxx")]
+ public float ParallaxX { get; set; }
+
+ [XmlAttribute(AttributeName = "parallaxy")]
+ public float ParallaxY { get; set; }
+
+ [XmlArray("properties")]
+ [XmlArrayItem("property")]
+ public List<TiledMapPropertyContent> Properties { get; set; }
+
+ [XmlIgnore]
+ public TiledMapLayerType LayerType { get; }
+
+ public override string ToString()
+ {
+ return Name;
+ }
+ }
+}