Added int2.Clamp(Rectangle). All queries for map geometry use map.Bounds.

This commit is contained in:
Paul Chote
2010-11-24 12:24:48 +13:00
parent 1dfe437641
commit fc5830a687
14 changed files with 63 additions and 52 deletions

View File

@@ -67,8 +67,7 @@ namespace OpenRA
index = (byte)(tile.Value.PickAny ? 0xffu : 0) } } };
PlayerCount = 0;
TopLeft = new int2(0, 0);
BottomRight = new int2(0, 0);
ResizeCordon(0,0,0,0);
Title = "Name your map here";
Description = "Describe your map here";
@@ -349,5 +348,12 @@ namespace OpenRA
MapResources = ResizeArray(MapResources, MapResources[0, 0], width, height);
MapSize = new int2(width, height);
}
public void ResizeCordon(int left, int top, int right, int bottom)
{
TopLeft = new int2(left, top);
BottomRight = new int2(right, bottom);
Bounds = Rectangle.FromLTRB(TopLeft.X, TopLeft.Y, BottomRight.X, BottomRight.Y);
}
}
}