Move ClampToWorld from WorldUtils to Map

This commit is contained in:
Pavlos Touboulidis
2014-06-13 13:59:40 +03:00
parent c282fa1077
commit 77fb188585
6 changed files with 11 additions and 11 deletions

View File

@@ -550,5 +550,11 @@ namespace OpenRA
var tileSet = Rules.TileSets[Tileset];
return tileSet[GetTerrainIndex(cell)];
}
public CPos Clamp(CPos xy)
{
var r = Bounds;
return xy.Clamp(new Rectangle(r.X, r.Y, r.Width - 1, r.Height - 1));
}
}
}