Created
June 16, 2019 11:50
-
-
Save brcdev/7d46c412309b1607296add543cfb2158 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package net.brcdev.shopgui.provider.economy; | |
import org.bukkit.entity.Player; | |
public abstract class EconomyProvider { | |
/** | |
* Gets the money balance of specified player | |
* | |
* @param player Player to check balance | |
* @return money balance | |
*/ | |
public abstract double getBalance(Player player); | |
/** | |
* Adds the specified money amount to player's balance | |
* | |
* @param player Player whose balance shall be modified | |
* @param amount Money amount | |
*/ | |
public abstract void deposit(Player player, double amount); | |
/** | |
* Removes the specified money amount from player's balance | |
* | |
* @param player Player whose balance shall be modified | |
* @param amount Money amount | |
*/ | |
public abstract void withdraw(Player player, double amount); | |
/** | |
* Checks whether player's balance is equal or higher than the specified money amount | |
* | |
* @param player Player whose balance shall be checked | |
* @param amount Amount required from player | |
* @return whether player has enough money | |
*/ | |
public boolean has(Player player, double amount) { | |
return getBalance(player) >= amount; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment