Added a permanent power command

This commit is contained in:
Olof Larsson
2011-10-22 18:12:15 +02:00
parent 7ebed6db9c
commit 2ac96f4278
6 changed files with 73 additions and 0 deletions

View File

@@ -129,6 +129,12 @@ public class Faction extends Entity implements EconomyParticipator
return Econ.getMethod().getAccount(aid);
}
// FIELD: permanentPower
private Integer permanentPower;
public Integer getPermanentPower() { return this.permanentPower; }
public void setPermanentPower(Integer permanentPower) { this.permanentPower = permanentPower; }
public boolean hasPermanentPower() { return this.permanentPower != null; }
// -------------------------------------------- //
// Construct
// -------------------------------------------- //
@@ -247,6 +253,11 @@ public class Faction extends Entity implements EconomyParticipator
//----------------------------------------------//
public double getPower()
{
if (this.hasPermanentPower())
{
return this.getPermanentPower();
}
double ret = 0;
for (FPlayer fplayer : this.getFPlayers())
{
@@ -261,6 +272,11 @@ public class Faction extends Entity implements EconomyParticipator
public double getPowerMax()
{
if (this.hasPermanentPower())
{
return this.getPermanentPower();
}
double ret = 0;
for (FPlayer fplayer : this.getFPlayers())
{