Seperated power into 'power provided' and 'power consumed'

This commit is contained in:
Matthew Bowra-Dean
2009-11-10 19:01:40 +13:00
parent a60be98721
commit abac3bd59d
3 changed files with 18 additions and 4 deletions

View File

@@ -11,7 +11,8 @@ namespace OpenRa.Game
public Race Race;
public readonly int Index;
public int Cash;
public int Power;
int powerProvided;
int powerDrained;
public Player( int index, int palette, string playerName, Race race )
{
@@ -20,7 +21,20 @@ namespace OpenRa.Game
this.PlayerName = playerName;
this.Race = race;
this.Cash = 10000;
this.Power = 0;
this.powerProvided = this.powerDrained = 0;
}
public void ChangePower(int dPower)
{
if (dPower > 0)
powerProvided += dPower;
if (dPower < 0)
powerDrained -= dPower;
}
public int GetTotalPower()
{
return powerProvided - powerDrained;
}
public float GetSiloFullness()