public interface BankAccount
Modifier and Type | Method and Description |
---|---|
boolean |
add(java.math.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 VALUES
|
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
|
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
|
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
|
java.math.BigDecimal |
getBalance()
Gets balance of the account
|
java.util.UUID |
getIdentifier()
Gets the unique identifier of the given entity
|
boolean |
hasBalance(java.math.BigDecimal amount)
Checks if the account has more than the given amount
|
default boolean |
hasBalance(double amount)
Checks if the account has more than the given amount
|
default boolean |
hasBalance(float amount)
Checks if the account has more than the given amount
|
default boolean |
hasBalance(int amount)
Checks if the account has more than the given amount
|
void |
setBalance(java.math.BigDecimal amount)
Sets the balance of the account
|
default void |
setBalance(double amount)
Sets the balance of the account
|
default void |
setBalance(float amount)
Sets the balance of the account
|
default void |
setBalance(int amount)
Sets the balance of the account
|
boolean |
take(java.math.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 VALUES
|
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
|
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
|
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
|
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 by
getBalance() |
default void |
updatePlayer(java.math.BigDecimal amount)
Sends an update packet to the client of the player to update any local references to their balance
|
java.util.UUID getIdentifier()
java.math.BigDecimal getBalance()
default void setBalance(int amount)
amount
- The new balancedefault void setBalance(double amount)
amount
- The new balancedefault void setBalance(float amount)
amount
- The new balancevoid setBalance(java.math.BigDecimal amount)
amount
- The new balancedefault boolean hasBalance(float amount)
amount
- Amount to checkdefault boolean hasBalance(double amount)
amount
- Amount to checkdefault boolean hasBalance(int amount)
amount
- Amount to checkboolean hasBalance(java.math.BigDecimal amount)
amount
- Amount to checkdefault boolean take(int amount)
amount
- The amount being takendefault boolean take(float amount)
amount
- The amount being takendefault boolean take(double amount)
amount
- The amount being takenboolean take(java.math.BigDecimal amount)
amount
- The amount being takendefault boolean add(int amount)
amount
- The amount being addeddefault boolean add(float amount)
amount
- The amount being addeddefault boolean add(double amount)
amount
- The amount being addedboolean add(java.math.BigDecimal amount)
amount
- The amount being addeddefault void updatePlayer(java.math.BigDecimal amount)
amount
- The amount being updated todefault void updatePlayer()
getBalance()