Package ovh.mythmc.banco.api.accounts
Class AccountManager
java.lang.Object
ovh.mythmc.banco.api.accounts.AccountManager
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription@NotNull BigDecimal
Gets an account's balancevoid
clear()
void
deposit
(@NotNull Account account, @NotNull BigDecimal amount) Deposits an amount of money to an accountget()
Gets a list of registered accountsGets a specific account by its UUIDgetTop
(int limit) Gets a LinkedHashMap ordered by players with the highest balancegetTopPosition
(int pos) Gets an entry with the account's UUID and balance at the specified top positionboolean
has
(@NotNull Account account, @NotNull BigDecimal amount) Checks if an account has an amount of moneyvoid
registerAccount
(@NotNull Account account) Registers an accountvoid
set
(@NotNull Account account, @NotNull BigDecimal amount) Sets an account's balance to a specified amountvoid
unregisterAccount
(@NotNull Account account) Registers an accountvoid
updateTransactions
(@NotNull Account account) void
withdraw
(@NotNull Account account, @NotNull BigDecimal amount) Withdraws an amount of money from an account
-
Field Details
-
instance
-
-
Constructor Details
-
AccountManager
public AccountManager()
-
-
Method Details
-
registerAccount
Registers an account- Parameters:
account
- account to register
-
unregisterAccount
Registers an account- Parameters:
account
- account to unregister
-
clear
@Internal public void clear() -
get
Gets a list of registered accounts- Returns:
- List of registered accounts
-
get
Gets a specific account by its UUID- Parameters:
uuid
- UUID of the player- Returns:
- UUID's account
-
deposit
Deposits an amount of money to an account- Parameters:
account
- account that will be modifiedamount
- amount of money to deposit
-
withdraw
Withdraws an amount of money from an account- Parameters:
account
- account that will be modifiedamount
- amount of money to withdraw
-
set
Sets an account's balance to a specified amount- Parameters:
account
- account that will be modifiedamount
- amount of money to set
-
has
Checks if an account has an amount of money- Parameters:
account
- account to checkamount
- amount to check- Returns:
- true if account has more than the specified amount
-
amount
Gets an account's balance- Parameters:
account
- account to check- Returns:
- Account's balance
-
updateTransactions
-
getTop
Gets a LinkedHashMap ordered by players with the highest balance- Parameters:
limit
- how many entries should map return- Returns:
- A LinkedHashMap ordered by players with the highest balance
-
getTopPosition
Gets an entry with the account's UUID and balance at the specified top position- Parameters:
pos
- position to get- Returns:
- An entry with account's UUID and money amount
-