Begin cleaning up terraintypes/movetypes

This commit is contained in:
Paul Chote
2010-06-25 15:52:12 +12:00
parent 7ac8d0cf59
commit 6a5869f2c6
6 changed files with 38 additions and 32 deletions

View File

@@ -61,6 +61,14 @@ namespace OpenRA.Traits
return self.World.WorldActor.traits.Get<AircraftInfluence>().GetUnitsAt(p).Count() == 0;
}
public float MovementCostForCell(Actor self, int2 cell)
{
if (!self.World.Map.IsInMap(cell.X,cell.Y))
return float.PositiveInfinity;
return self.World.WorldActor.traits.WithInterface<ICustomTerrain>().Aggregate(1f, (a, x) => a * x.GetCost(cell,self));
}
public override IEnumerable<int2> OccupiedCells()
{