Class PlayerStatistics
java.lang.Object
us.teaminceptus.novaconomy.api.player.PlayerStatistics
- All Implemented Interfaces:
ConfigurationSerializable
Represents NovaPlayer Statistics
-
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull PlayerStatisticsdeserialize(@NotNull Map<String, Object> serial) Deserializes a Map into a PlayerStatistics object.@Nullable PriceCreates a Price representation of the highest balance this Player has ever had.@NotNull OfflinePlayerFetches the player that these statistics belong tointFetches the total amount of Products Purchased.intFetches the total amount of bounties this Player has created.intFetches the total amount of bounties this Player has been the target of.doubleFetches the total amount of money added to this Player's account.doubleFetches the total amount of money this player has spent.intFetches the total amount of Market Shares purchased.doubleFetches the total amount of money withdrawn from the Bank.@NotNull List<BusinessStatistics.Transaction>Fetches an immutable version of the last 10 transactions this Player has made.voidsetProductsPurchased(int productsPurchased) Sets the amount of Products Purchased.voidsetTransactionHistory(@NotNull List<BusinessStatistics.Transaction> history) Sets the current transaction history for this Player.
-
Method Details
-
deserialize
@NotNull public static @NotNull PlayerStatistics deserialize(@NotNull @NotNull Map<String, Object> serial) throws IllegalArgumentExceptionDeserializes a Map into a PlayerStatistics object.- Parameters:
serial- Map to deserialize- Returns:
- PlayerStatistics object
- Throws:
IllegalArgumentException- if map is missing keys or malformed
-
getPlayer
Fetches the player that these statistics belong to- Returns:
- Player that owns these Statistics
-
getProductsPurchased
public int getProductsPurchased()Fetches the total amount of Products Purchased.- Returns:
- Total amount of Products Purchased
-
getTotalMoneyAdded
public double getTotalMoneyAdded()Fetches the total amount of money added to this Player's account.- Returns:
- Total Money Added
-
getTotalMoneySpent
public double getTotalMoneySpent()Fetches the total amount of money this player has spent.- Returns:
- Total Money Spent
-
getHighestBalance
Creates a Price representation of the highest balance this Player has ever had.- Returns:
- Price representation of the highest balance this Player has ever had
-
getTotalWithdrawn
public double getTotalWithdrawn()Fetches the total amount of money withdrawn from the Bank.- Returns:
- Total Amount this Player has withdrawn from the Bank
-
getTotalBountiesCreated
public int getTotalBountiesCreated()Fetches the total amount of bounties this Player has created.- Returns:
- Total amount of bounties this Player has created
-
getTotalBountiesTargeted
public int getTotalBountiesTargeted()Fetches the total amount of bounties this Player has been the target of.- Returns:
- Total amount of bounties this Player has been the target of
-
setProductsPurchased
public void setProductsPurchased(int productsPurchased) Sets the amount of Products Purchased.- Parameters:
productsPurchased- Amount of Products Purchased
-
getTransactionHistory
Fetches an immutable version of the last 10 transactions this Player has made.- Returns:
- Last 10 transactions this Player has made
-
setTransactionHistory
Sets the current transaction history for this Player.- Parameters:
history- Transaction history to set
-
serialize
- Specified by:
serializein interfaceConfigurationSerializable
-