Interface BankAccount
- All Known Implementing Classes:
PlayerPartyStorage
public interface BankAccount
Represents a storage of an economy for a given entity
-
Method Summary
Modifier and TypeMethodDescriptiondefault boolean
add
(double amount) Adds the amount to the current balance Returns false if the transaction fails for any given reason (check console logs) DO NOT PASS NEGATIVE VALUESdefault boolean
add
(float amount) Adds the amount to the current balance Returns false if the transaction fails for any given reason (check console logs) DO NOT PASS NEGATIVE VALUESdefault boolean
add
(int amount) Adds the amount to the current balance Returns false if the transaction fails for any given reason (check console logs) DO NOT PASS NEGATIVE VALUESboolean
add
(BigDecimal amount) Adds the amount to the current balance Returns false if the transaction fails for any given reason (check console logs) DO NOT PASS NEGATIVE VALUESGets balance of the accountGets the unique identifier of the given entitydefault boolean
hasBalance
(double amount) Checks if the account has more than the given amountdefault boolean
hasBalance
(float amount) Checks if the account has more than the given amountdefault boolean
hasBalance
(int amount) Checks if the account has more than the given amountboolean
hasBalance
(BigDecimal amount) Checks if the account has more than the given amountdefault void
setBalance
(double amount) Sets the balance of the accountdefault void
setBalance
(float amount) Sets the balance of the accountdefault void
setBalance
(int amount) Sets the balance of the accountvoid
setBalance
(BigDecimal amount) Sets the balance of the accountdefault boolean
take
(double amount) Take the amount to the current balance Returns false if the transaction fails for any given reason (check console logs) DO NOT PASS NEGATIVE VALUESdefault boolean
take
(float amount) Take the amount to the current balance Returns false if the transaction fails for any given reason (check console logs) DO NOT PASS NEGATIVE VALUESdefault boolean
take
(int amount) Take the amount to the current balance Returns false if the transaction fails for any given reason (check console logs) DO NOT PASS NEGATIVE VALUESboolean
take
(BigDecimal amount) Take the amount to the current balance Returns false if the transaction fails for any given reason (check console logs) DO NOT PASS NEGATIVE VALUESdefault void
Sends an update packet to the client of the player to update any local references to their balance Sends them the amount returned bygetBalance()
default void
updatePlayer
(BigDecimal amount) Sends an update packet to the client of the player to update any local references to their balance
-
Method Details
-
getIdentifier
UUID getIdentifier()Gets the unique identifier of the given entity- Returns:
- The identifier
-
getBalance
BigDecimal getBalance()Gets balance of the account- Returns:
- The amount of money
-
setBalance
default void setBalance(int amount) Sets the balance of the account- Parameters:
amount
- The new balance
-
setBalance
default void setBalance(double amount) Sets the balance of the account- Parameters:
amount
- The new balance
-
setBalance
default void setBalance(float amount) Sets the balance of the account- Parameters:
amount
- The new balance
-
setBalance
Sets the balance of the account- Parameters:
amount
- The new balance
-
hasBalance
default boolean hasBalance(float amount) Checks if the account has more than the given amount- Parameters:
amount
- Amount to check- Returns:
- True if the account has more
-
hasBalance
default boolean hasBalance(double amount) Checks if the account has more than the given amount- Parameters:
amount
- Amount to check- Returns:
- True if the account has more
-
hasBalance
default boolean hasBalance(int amount) Checks if the account has more than the given amount- Parameters:
amount
- Amount to check- Returns:
- True if the account has more
-
hasBalance
Checks if the account has more than the given amount- Parameters:
amount
- Amount to check- Returns:
- True if the account has more
-
take
default boolean take(int amount) Take the amount to the current balance Returns false if the transaction fails for any given reason (check console logs) DO NOT PASS NEGATIVE VALUES- Parameters:
amount
- The amount being taken- Returns:
- true if successful
-
take
default boolean take(float amount) Take the amount to the current balance Returns false if the transaction fails for any given reason (check console logs) DO NOT PASS NEGATIVE VALUES- Parameters:
amount
- The amount being taken- Returns:
- true if successful
-
take
default boolean take(double amount) Take the amount to the current balance Returns false if the transaction fails for any given reason (check console logs) DO NOT PASS NEGATIVE VALUES- Parameters:
amount
- The amount being taken- Returns:
- true if successful
-
take
Take the amount to the current balance Returns false if the transaction fails for any given reason (check console logs) DO NOT PASS NEGATIVE VALUES- Parameters:
amount
- The amount being taken- Returns:
- true if successful
-
add
default boolean add(int amount) Adds the amount to the current balance Returns false if the transaction fails for any given reason (check console logs) DO NOT PASS NEGATIVE VALUES- Parameters:
amount
- The amount being added- Returns:
- true if successful
-
add
default boolean add(float amount) Adds the amount to the current balance Returns false if the transaction fails for any given reason (check console logs) DO NOT PASS NEGATIVE VALUES- Parameters:
amount
- The amount being added- Returns:
- true if successful
-
add
default boolean add(double amount) Adds the amount to the current balance Returns false if the transaction fails for any given reason (check console logs) DO NOT PASS NEGATIVE VALUES- Parameters:
amount
- The amount being added- Returns:
- true if successful
-
add
Adds the amount to the current balance Returns false if the transaction fails for any given reason (check console logs) DO NOT PASS NEGATIVE VALUES- Parameters:
amount
- The amount being added- Returns:
- true if successful
-
updatePlayer
Sends an update packet to the client of the player to update any local references to their balance- Parameters:
amount
- The amount being updated to
-
updatePlayer
default void updatePlayer()Sends an update packet to the client of the player to update any local references to their balance Sends them the amount returned bygetBalance()
-