From b221787350d7908f5ac2ce26fd191efc8aad04b5 Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Wed, 13 Dec 2017 19:30:39 +0000 Subject: [PATCH] Allow CellRegions to be created with MPos. --- OpenRA.Game/Map/CellRegion.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/OpenRA.Game/Map/CellRegion.cs b/OpenRA.Game/Map/CellRegion.cs index e702e9db18..cb3fca8683 100644 --- a/OpenRA.Game/Map/CellRegion.cs +++ b/OpenRA.Game/Map/CellRegion.cs @@ -40,6 +40,16 @@ namespace OpenRA mapBottomRight = BottomRight.ToMPos(gridType); } + public CellRegion(MapGridType gridType, MPos topLeft, MPos bottomRight) + { + this.gridType = gridType; + mapTopLeft = topLeft; + mapBottomRight = bottomRight; + + TopLeft = topLeft.ToCPos(gridType); + BottomRight = bottomRight.ToCPos(gridType); + } + /// Expand the specified region with an additional cordon. This may expand the region outside the map borders. public static CellRegion Expand(CellRegion region, int cordon) {