From a518f07e250e08936126d38219e9ec1215391584 Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Sat, 14 Jan 2017 14:53:18 +0000 Subject: [PATCH] Remove CPos.Max/Min. --- OpenRA.Game/CPos.cs | 3 --- OpenRA.Mods.RA/Traits/Minelayer.cs | 4 ++-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/OpenRA.Game/CPos.cs b/OpenRA.Game/CPos.cs index 914f9a7e49..cfd2cbe47d 100644 --- a/OpenRA.Game/CPos.cs +++ b/OpenRA.Game/CPos.cs @@ -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 == 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 bool Equals(CPos other) { return X == other.X && Y == other.Y; } diff --git a/OpenRA.Mods.RA/Traits/Minelayer.cs b/OpenRA.Mods.RA/Traits/Minelayer.cs index 4aa7388f12..3e6b449727 100644 --- a/OpenRA.Mods.RA/Traits/Minelayer.cs +++ b/OpenRA.Mods.RA/Traits/Minelayer.cs @@ -100,8 +100,8 @@ namespace OpenRA.Mods.RA.Traits static IEnumerable GetMinefieldCells(CPos start, CPos end, WDist depth) { - var mins = CPos.Min(start, end); - var maxs = CPos.Max(start, end); + var mins = new CPos(Math.Min(start.X, end.X), Math.Min(start.Y, end.Y)); + 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) */