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 booleanadd(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 booleanadd(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 booleanadd(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 VALUESbooleanadd(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 booleanhasBalance(double amount) Checks if the account has more than the given amountdefault booleanhasBalance(float amount) Checks if the account has more than the given amountdefault booleanhasBalance(int amount) Checks if the account has more than the given amountbooleanhasBalance(BigDecimal amount) Checks if the account has more than the given amountdefault voidsetBalance(double amount) Sets the balance of the accountdefault voidsetBalance(float amount) Sets the balance of the accountdefault voidsetBalance(int amount) Sets the balance of the accountvoidsetBalance(BigDecimal amount) Sets the balance of the accountdefault booleantake(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 booleantake(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 booleantake(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 VALUESbooleantake(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 voidSends an update packet to the client of the player to update any local references to their balance Sends them the amount returned bygetBalance()default voidupdatePlayer(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()
-