Added faction banks.

This commit is contained in:
Harry Jeffery
2011-09-24 02:22:53 +01:00
parent 31937b6756
commit 2b23f93fba
13 changed files with 363 additions and 21 deletions

View File

@@ -39,6 +39,7 @@ public class Faction {
private String description;
private Location home;
private transient long lastPlayerLoggedOffTime;
private double money;
// -------------------------------------------- //
// Construct
@@ -54,6 +55,7 @@ public class Faction {
this.peaceful = false;
this.peacefulExplosionsEnabled = false;
this.permanent = false;
this.money = 0.0;
}
// -------------------------------------------- //
@@ -592,6 +594,30 @@ public class Faction {
return false;
}
public double getMoney() {
return this.money;
}
public boolean addMoney(double amount) {
if ( amount > 0.0 )
{
this.money += amount;
return true;
}
return false;
}
public boolean removeMoney( double amount ) {
if (amount <= 0.0 )
return false;
if (amount > this.money )
return false;
this.money -= amount;
return true;
}
//----------------------------------------------//
// Persistance and entity management