Beginnings of building power tracking

This commit is contained in:
Matthew Bowra-Dean
2009-11-09 21:57:42 +13:00
parent 14e2e3c2eb
commit a96a7523c8
8 changed files with 77 additions and 69 deletions

View File

@@ -2,10 +2,11 @@
using System.Collections.Generic;
using System.Linq;
using System.Text;
using OpenRa.Game.GameRules;
namespace OpenRa.Game.Traits
{
class Building : ITick
class Building : ITick, INotifyBuildComplete
{
public Building(Actor self)
{
@@ -19,5 +20,13 @@ namespace OpenRa.Game.Traits
first = false;
}
public void BuildingComplete(Actor self)
{
UnitInfo.BuildingInfo bi = self.unitInfo as UnitInfo.BuildingInfo;
if (bi == null) return;
self.Owner.Power += bi.Power;
}
}
}