support power impl; incomplete

This commit is contained in:
Chris Forbes
2010-01-08 20:57:53 +13:00
parent 8a3f6c501c
commit cc0498314e
7 changed files with 118 additions and 36 deletions

View File

@@ -28,6 +28,7 @@ namespace OpenRa.Game
public bool IsReady;
public Shroud Shroud = new Shroud();
public Dictionary<string, SupportPower> SupportPowers;
public Player( Actor playerActor, int index, PaletteType palette, string playerName, Race race, string internalName )
{
@@ -37,6 +38,10 @@ namespace OpenRa.Game
this.InternalName = internalName;
this.PlayerName = playerName;
this.Race = race;
SupportPowers = Rules.SupportPowerInfo.ToDictionary(
spi => spi.Key,
spi => new SupportPower(spi.Value, this));
}
void UpdatePower()
@@ -126,6 +131,9 @@ namespace OpenRa.Game
UpdatePower();
UpdateOreCapacity();
foreach (var sp in SupportPowers.Values)
sp.Tick();
if (this == Game.LocalPlayer)
{
var totalMoney = Cash + Ore;