Interface EconomyAdapter
- All Known Implementing Classes:
ReserveEconomyAdapter
,VaultEconomyAdapter
public interface EconomyAdapter
An adapter that is used to adapt multiple
economy implementations.
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Attempts to add money to an account.void
deleteAccount
(String accountName) Removes an account.double
getBalance
(String accountName, org.bukkit.World world) Gets the balance of the account.getFormattedBalance
(double balance) Get's the proper formatting for a given balance.boolean
hasAccount
(String accountName) Checks whether the given account exists.void
newAccount
(String accountName) Attempts to create an account.boolean
setBalance
(String accountName, double amount, org.bukkit.World world) Sets the balance of the account.boolean
Attempts to subtract money from an account.
-
Method Details
-
add
Attempts to add money to an account.- Parameters:
accountName
- The name of the account.amount
- The amount to add.world
- The world this account is in.- Returns:
- A boolean indicating success.
-
subtract
Attempts to subtract money from an account.- Parameters:
accountName
- The name of the account.amount
- The amount to add.world
- The world this account is in.- Returns:
- A boolean indicating success.
-
hasAccount
Checks whether the given account exists.- Parameters:
accountName
- The name of the account.- Returns:
- A boolean indicating success.
-
getBalance
Gets the balance of the account.- Parameters:
accountName
- The name of the account.world
- The world this account is in.- Returns:
- A boolean indicating success.
-
newAccount
Attempts to create an account.- Parameters:
accountName
- The name of the new account.
-
deleteAccount
Removes an account.- Parameters:
accountName
- The name of the account to remove.
-
setBalance
Sets the balance of the account.- Parameters:
accountName
- The name of the account.amount
- The amount to add.world
- The world this account is in.- Returns:
- A boolean indicating success.
-
getFormattedBalance
Get's the proper formatting for a given balance.- Parameters:
balance
- The balance to format.- Returns:
- A string with the balance formatted.
-