diff --git a/MLEM/Misc/Direction2.cs b/MLEM/Misc/Direction2.cs index f33bd4f..107df3d 100644 --- a/MLEM/Misc/Direction2.cs +++ b/MLEM/Misc/Direction2.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Runtime.Serialization; using Microsoft.Xna.Framework; namespace MLEM.Misc { @@ -10,45 +11,55 @@ namespace MLEM.Misc { /// There are several extension methods and arrays available in . /// [Flags] + [DataContract] public enum Direction2 { /// /// No direction. /// + [EnumMember] None = 0, /// /// The up direction, or -y. /// + [EnumMember] Up = 1, /// /// The right direction, or +x. /// + [EnumMember] Right = 2, /// /// The down direction, or +y. /// + [EnumMember] Down = 4, /// /// The left direction, or -x. /// + [EnumMember] Left = 8, /// /// The up and right direction, or +x, -y. /// + [EnumMember] UpRight = Up | Right, /// /// The down and right direction, or +x, +y. /// + [EnumMember] DownRight = Down | Right, /// /// The up and left direction, or -x, -y. /// + [EnumMember] UpLeft = Up | Left, /// /// The down and left direction, or -x, +y. /// + [EnumMember] DownLeft = Down | Left } diff --git a/MLEM/Misc/Padding.cs b/MLEM/Misc/Padding.cs index 7272d44..e69f631 100644 --- a/MLEM/Misc/Padding.cs +++ b/MLEM/Misc/Padding.cs @@ -1,3 +1,4 @@ +using System.Runtime.Serialization; using Microsoft.Xna.Framework; namespace MLEM.Misc { @@ -5,23 +6,28 @@ namespace MLEM.Misc { /// Represents a generic padding. /// A padding is an object of data that stores an offset from each side of a rectangle or square. /// + [DataContract] public struct Padding { /// /// The amount of padding on the left side /// + [DataMember] public float Left; /// /// The amount of padding on the right side /// + [DataMember] public float Right; /// /// The amount of padding on the top side /// + [DataMember] public float Top; /// /// The amount of padding on the bottom side /// + [DataMember] public float Bottom; /// /// The total width of this padding, a sum of the left and right padding.