finished building *Infos

This commit is contained in:
Chris Forbes
2010-01-10 17:28:05 +13:00
parent 9add15464c
commit 12b84a8468
48 changed files with 121 additions and 147 deletions

View File

@@ -9,10 +9,15 @@ using OpenRa.Game.Graphics;
namespace OpenRa.Game.Traits
{
class BuildingInfo : ITraitInfo
{
public object Create(Actor self) { return new Building(self); }
}
class Building : INotifyDamage, IResolveOrder, ITick
{
readonly Actor self;
public readonly BuildingInfo unitInfo;
public readonly LegacyBuildingInfo unitInfo;
[Sync]
bool isRepairing = false;
[Sync]
@@ -24,7 +29,7 @@ namespace OpenRa.Game.Traits
public Building(Actor self)
{
this.self = self;
unitInfo = (BuildingInfo)self.Info;
unitInfo = (LegacyBuildingInfo)self.Info;
self.CenterLocation = Game.CellSize
* ((float2)self.Location + .5f * (float2)unitInfo.Dimensions);
}