almost. got a problem with missing tiles, though

This commit is contained in:
Chris Forbes
2010-01-19 13:05:20 +13:00
parent 61a543db3c
commit e07f4c926e

View File

@@ -15,7 +15,7 @@ namespace OpenRa.Traits
public object Create(Actor self) { return new Bridge(self); }
}
class Bridge : IRender, ICustomTerrain
class Bridge : IRender, ICustomTerrain, INotifyDamage
{
Dictionary<int2, int> Tiles;
List<Dictionary<int2, Sprite>> TileSprites = new List<Dictionary<int2,Sprite>>();
@@ -76,5 +76,12 @@ namespace OpenRa.Traits
return TerrainCosts.Cost(umt,
Templates[state].TerrainType[Tiles[p]]);
}
public void Damaged(Actor self, AttackInfo e)
{
// todo: long bridges have d/e/f states too.
if (e.DamageStateChanged)
state = (int)e.DamageState;
}
}
}