Allow CellRegions to be created with MPos.

This commit is contained in:
Paul Chote
2017-12-13 19:30:39 +00:00
committed by abcdefg30
parent d24d80f483
commit b221787350

View File

@@ -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);
}
/// <summary>Expand the specified region with an additional cordon. This may expand the region outside the map borders.</summary>
public static CellRegion Expand(CellRegion region, int cordon)
{