public class Account
extends java.lang.Object
| Constructor and Description |
|---|
Account(java.lang.String name,
boolean bankAccount,
boolean infiniteMoney,
boolean ignoreACL)
Load a account.
|
| Modifier and Type | Method and Description |
|---|---|
double |
deposit(double amount,
java.lang.String world,
java.lang.String currencyName)
|
double |
deposit(double amount,
java.lang.String world,
java.lang.String currencyName,
Cause cause,
java.lang.String causeReason)
Adds a certain amount of money in the account
|
static double |
format(double value)
Format the value to be something less problematic.
|
AccountACL |
getAccountACL()
Get the account ACL.
|
java.lang.String |
getAccountName()
Returns the account name.
|
java.util.List<Balance> |
getAllBalance()
Get the whole account balance
|
java.util.List<Balance> |
getAllWorldBalance(java.lang.String world)
Get the whole account balance in a certain world / world group
|
double |
getBalance(java.lang.String world,
java.lang.String currencyName)
Get's the player balance.
|
static java.lang.String |
getWorldGroupOfPlayerCurrentlyIn(java.lang.String playerName)
Retrieve the world group of the player
|
boolean |
hasEnough(double amount,
java.lang.String worldName,
java.lang.String currencyName)
Checks if we have enough money in a certain balance
|
boolean |
hasInfiniteMoney()
Checks if the account have infinite money
|
boolean |
ignoreACL()
Check if the ACL is ignored for a bank account.
|
boolean |
isBankAccount()
Checks if this account is a bank account
|
double |
set(double amount,
java.lang.String world,
java.lang.String currencyName)
|
double |
set(double amount,
java.lang.String world,
java.lang.String currencyName,
Cause cause,
java.lang.String causeReason)
set a certain amount of money in the account
|
void |
setIgnoreACL(boolean ignore)
Sets if a account should ignore his ACL.
|
void |
setInfiniteMoney(boolean infinite)
Sets the account to have infinite money.
|
double |
withdraw(double amount,
java.lang.String world,
java.lang.String currencyName)
|
double |
withdraw(double amount,
java.lang.String world,
java.lang.String currencyName,
Cause cause,
java.lang.String causeReason)
withdraw a certain amount of money in the account
|
public Account(java.lang.String name,
boolean bankAccount,
boolean infiniteMoney,
boolean ignoreACL)
name - The account namebankAccount - If the account is a bank accountinfiniteMoney - If the account have no money limitignoreACL - If the account ignore it's ACL values (Bank only)public java.lang.String getAccountName()
public boolean isBankAccount()
public AccountACL getAccountACL()
public java.util.List<Balance> getAllBalance()
public java.util.List<Balance> getAllWorldBalance(java.lang.String world)
world - The world / world group to search inpublic double getBalance(java.lang.String world,
java.lang.String currencyName)
world - The world / world group to search incurrencyName - The currency Name@Deprecated
public double deposit(double amount,
java.lang.String world,
java.lang.String currencyName)
amount - The amount of money to addworld - The World / World group we want to add money incurrencyName - The currency we want to add money inpublic double deposit(double amount,
java.lang.String world,
java.lang.String currencyName,
Cause cause,
java.lang.String causeReason)
amount - The amount of money to addworld - The World / World group we want to add money incurrencyName - The currency we want to add money incause - The cause of the change.causeReason - The reason of the cause@Deprecated
public double withdraw(double amount,
java.lang.String world,
java.lang.String currencyName)
amount - The amount of money to withdrawworld - The World / World group we want to withdraw money fromcurrencyName - The currency we want to withdraw money frompublic double withdraw(double amount,
java.lang.String world,
java.lang.String currencyName,
Cause cause,
java.lang.String causeReason)
amount - The amount of money to withdrawworld - The World / World group we want to withdraw money fromcurrencyName - The currency we want to withdraw money fromcause - The cause of the change.causeReason - The reason of the cause.@Deprecated
public double set(double amount,
java.lang.String world,
java.lang.String currencyName)
amount - The amount of money to setworld - The World / World group we want to set money tocurrencyName - The currency we want to set money topublic double set(double amount,
java.lang.String world,
java.lang.String currencyName,
Cause cause,
java.lang.String causeReason)
amount - The amount of money to setworld - The World group we want to set money tocurrencyName - The currency we want to set money tocause - The cause of the change.causeReason - The reason of the cause.public boolean hasEnough(double amount,
java.lang.String worldName,
java.lang.String currencyName)
amount - The amount of money to checkworldName - The World / World group we want to checkcurrencyName - The currency we want to checkpublic static java.lang.String getWorldGroupOfPlayerCurrentlyIn(java.lang.String playerName)
playerName - The player namepublic void setInfiniteMoney(boolean infinite)
infinite - True if the account should have infinite money. Else false.public boolean hasInfiniteMoney()
public static double format(double value)
value - The double to formatpublic boolean ignoreACL()
public void setIgnoreACL(boolean ignore)
ignore - If the ACL is ignored or not