Interface EconomyService

All Known Implementing Classes:
InMemoryEconomyService, PostgresEconomyService

public interface EconomyService
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    depositCoins(UUID playerId, int amount)
    adds coins to the players account
    int
    getCoins(UUID playerId)
     
    void
    setCoins(UUID playerId, int amount)
     
    boolean
    tryWithdrawCoins(UUID playerId, int amount)
    tries to take coins from the player's account or returns false on insufficient funds
  • Method Details

    • getCoins

      int getCoins(UUID playerId)
      Throws:
      IllegalArgumentException - if amount is less than 0
    • depositCoins

      void depositCoins(UUID playerId, int amount)
      adds coins to the players account
      Parameters:
      playerId - uuid of player
      Throws:
      IllegalArgumentException - if amount is less than 0
    • tryWithdrawCoins

      boolean tryWithdrawCoins(UUID playerId, int amount)
      tries to take coins from the player's account or returns false on insufficient funds
      Parameters:
      playerId - uuid of player
      Returns:
      true on success, false on insufficient funds
      Throws:
      IllegalArgumentException - if amount is less than 0
    • setCoins

      void setCoins(UUID playerId, int amount)
      Parameters:
      playerId - uuid of player
      Throws:
      IllegalArgumentException - if amount is less than 0