rules-based terrain cost, part 1

This commit is contained in:
Chris Forbes
2010-04-02 15:14:58 +13:00
parent 45f9ec2f7e
commit 0596b08f2c
25 changed files with 235 additions and 239 deletions

View File

@@ -20,6 +20,7 @@
using System.Collections.Generic;
using System.Linq;
using OpenRA.GameRules;
namespace OpenRA.Traits
{
@@ -131,10 +132,10 @@ namespace OpenRA.Traits
}
if (!crushable) return false;
return self.World.Map.IsInMap(a.X, a.Y) &&
TerrainCosts.Cost(GetMovementType(),
self.World.TileSet.GetTerrainType(self.World.Map.MapTiles[a.X, a.Y])) < double.PositiveInfinity;
Rules.TerrainTypes[self.World.TileSet.GetTerrainType(self.World.Map.MapTiles[a.X, a.Y])]
.GetCost(GetMovementType()) < float.PositiveInfinity;
}
public IEnumerable<int2> GetCurrentPath()