Remove CPos.Max/Min.

This commit is contained in:
Paul Chote
2017-01-14 14:53:18 +00:00
parent 171e558c0a
commit a518f07e25
2 changed files with 2 additions and 5 deletions

View File

@@ -33,9 +33,6 @@ namespace OpenRA
public static bool operator ==(CPos me, CPos other) { return me.X == other.X && me.Y == other.Y; } public static bool operator ==(CPos me, CPos other) { return me.X == other.X && me.Y == other.Y; }
public static bool operator !=(CPos me, CPos other) { return !(me == other); } public static bool operator !=(CPos me, CPos other) { return !(me == other); }
public static CPos Max(CPos a, CPos b) { return new CPos(Math.Max(a.X, b.X), Math.Max(a.Y, b.Y)); }
public static CPos Min(CPos a, CPos b) { return new CPos(Math.Min(a.X, b.X), Math.Min(a.Y, b.Y)); }
public override int GetHashCode() { return X.GetHashCode() ^ Y.GetHashCode(); } public override int GetHashCode() { return X.GetHashCode() ^ Y.GetHashCode(); }
public bool Equals(CPos other) { return X == other.X && Y == other.Y; } public bool Equals(CPos other) { return X == other.X && Y == other.Y; }

View File

@@ -100,8 +100,8 @@ namespace OpenRA.Mods.RA.Traits
static IEnumerable<CPos> GetMinefieldCells(CPos start, CPos end, WDist depth) static IEnumerable<CPos> GetMinefieldCells(CPos start, CPos end, WDist depth)
{ {
var mins = CPos.Min(start, end); var mins = new CPos(Math.Min(start.X, end.X), Math.Min(start.Y, end.Y));
var maxs = CPos.Max(start, end); var maxs = new CPos(Math.Max(start.X, end.X), Math.Max(start.Y, end.Y));
/* TODO: proper endcaps, if anyone cares (which won't happen unless depth is large) */ /* TODO: proper endcaps, if anyone cares (which won't happen unless depth is large) */