Class PlayerStatistics

java.lang.Object
us.teaminceptus.novaconomy.api.player.PlayerStatistics
All Implemented Interfaces:
ConfigurationSerializable

public final class PlayerStatistics extends Object implements ConfigurationSerializable
Represents NovaPlayer Statistics
  • Method Details

    • deserialize

      @NotNull public static @NotNull PlayerStatistics deserialize(@NotNull @NotNull Map<String,Object> serial) throws IllegalArgumentException
      Deserializes a Map into a PlayerStatistics object.
      Parameters:
      serial - Map to deserialize
      Returns:
      PlayerStatistics object
      Throws:
      IllegalArgumentException - if map is missing keys or malformed
    • getPlayer

      @NotNull public @NotNull OfflinePlayer 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

      @Nullable public @Nullable Price 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
    • getTotalSharesPurchased

      public int getTotalSharesPurchased()
      Fetches the total amount of Market Shares purchased.
      Returns:
      Total amount of Market Shares purchased
    • getTransactionHistory

      @NotNull public @NotNull List<BusinessStatistics.Transaction> getTransactionHistory()
      Fetches an immutable version of the last 10 transactions this Player has made.
      Returns:
      Last 10 transactions this Player has made
    • setTransactionHistory

      public void setTransactionHistory(@NotNull @NotNull List<BusinessStatistics.Transaction> history)
      Sets the current transaction history for this Player.
      Parameters:
      history - Transaction history to set
    • serialize

      @NotNull public @NotNull Map<String,Object> serialize()
      Specified by:
      serialize in interface ConfigurationSerializable