Fix ICustomTerrain to also work for resources

This commit is contained in:
Paul Chote
2010-04-17 20:06:14 +12:00
committed by Chris Forbes
parent 70e26bb047
commit 4a6c32bd9c
10 changed files with 84 additions and 61 deletions

View File

@@ -40,7 +40,21 @@ namespace OpenRA.GameRules
public readonly bool AcceptSmudge = true;
public TerrainCost(MiniYaml y) { FieldLoader.Load(this, y); }
public float GetSpeedMultiplier(UnitMovementType umt)
{
switch (umt) /* todo: make this nice */
{
case UnitMovementType.Fly: return 1;
case UnitMovementType.Foot: return Foot;
case UnitMovementType.Wheel: return Wheel;
case UnitMovementType.Track: return Track;
case UnitMovementType.Float: return Float;
default:
throw new InvalidOperationException("wtf?");
}
}
public float GetCost(UnitMovementType umt)
{
switch (umt) /* todo: make this nice */