diff --git a/OpenRA.FileFormats/WRange.cs b/OpenRA.FileFormats/WRange.cs index 42a390e27f..1275376d4e 100644 --- a/OpenRA.FileFormats/WRange.cs +++ b/OpenRA.FileFormats/WRange.cs @@ -8,6 +8,7 @@ */ #endregion +using System; using System.Linq; namespace OpenRA @@ -15,7 +16,7 @@ namespace OpenRA /// /// 1d world distance - 1024 units = 1 cell. /// - public struct WRange + public struct WRange : IComparable { public readonly int Range; @@ -82,6 +83,15 @@ namespace OpenRA return o != null && o == this; } + public int CompareTo(object obj) + { + var o = obj as WRange?; + if (o == null) + return 1; + + return Range.CompareTo(o.Value.Range); + } + public override string ToString() { return "{0}".F(Range); } } }