Move GetTerrainIndex/Info from WorldUtils to Map

This commit is contained in:
Pavlos Touboulidis
2014-06-13 13:57:32 +03:00
parent 0cf2d608e4
commit c282fa1077
20 changed files with 43 additions and 39 deletions

View File

@@ -88,17 +88,6 @@ namespace OpenRA
public const int MaxRange = 50;
static List<CVec>[] TilesByDistance = InitTilesByDistance(MaxRange);
public static int GetTerrainIndex(this World world, CPos cell)
{
var custom = world.Map.CustomTerrain[cell.X, cell.Y];
return custom != -1 ? custom : world.TileSet.GetTerrainIndex(world.Map.MapTiles.Value[cell.X, cell.Y]);
}
public static TerrainTypeInfo GetTerrainInfo(this World world, CPos cell)
{
return world.TileSet[world.GetTerrainIndex(cell)];
}
public static CPos ClampToWorld(this World world, CPos xy)
{
var r = world.Map.Bounds;