Files
OpenRA/OpenRa.Game/Traits/Building.cs
2009-12-19 10:42:35 +13:00

30 lines
576 B
C#

using OpenRa.Game.GameRules;
namespace OpenRa.Game.Traits
{
class Building : ITick, INotifyDamage
{
public readonly BuildingInfo unitInfo;
public Building(Actor self)
{
unitInfo = (BuildingInfo)self.Info;
}
bool first = true;
public void Tick(Actor self)
{
if (first)
self.CenterLocation = Game.CellSize * (float2)self.Location + 0.5f * self.SelectedSize;
first = false;
}
public void Damaged(Actor self, AttackInfo e)
{
if (e.DamageState == DamageState.Dead)
Sound.Play("kaboom22.aud");
}
}
}