Refactor int -> TerrainType. This had a bigger footprint than i initially intended.

This commit is contained in:
Paul Chote
2010-03-21 18:46:02 +13:00
parent 5b2dbc2389
commit 15a7eed603
13 changed files with 98 additions and 95 deletions

View File

@@ -49,7 +49,7 @@ namespace OpenRA
if (world.WorldActor.traits.Get<UnitInfluence>().GetUnitsAt(a).Any(b => b != toIgnore)) return false;
if (waterBound)
return world.Map.IsInMap(a.X,a.Y) && GetTerrainType(world,a) == TerrainMovementType.Water;
return world.Map.IsInMap(a.X,a.Y) && GetTerrainType(world,a) == TerrainType.Water;
return world.Map.IsInMap(a.X, a.Y) && TerrainCosts.Buildable(world.TileSet.GetTerrainType(world.Map.MapTiles[a.X, a.Y]));
}
@@ -129,9 +129,9 @@ namespace OpenRA
.FirstOrDefault();
}
public static TerrainMovementType GetTerrainType(this World world, int2 cell)
public static TerrainType GetTerrainType(this World world, int2 cell)
{
return (TerrainMovementType)world.TileSet.GetTerrainType(world.Map.MapTiles[cell.X, cell.Y]);
return (TerrainType)world.TileSet.GetTerrainType(world.Map.MapTiles[cell.X, cell.Y]);
}
public static bool CanPlaceBuilding(this World world, string name, BuildingInfo building, int2 topLeft, Actor toIgnore)