Package com.booksaw.betterTeams.cost
Class CommandCost
java.lang.Object
com.booksaw.betterTeams.cost.CommandCost
- Direct Known Subclasses:
CostManager.NoCost
-
Constructor Summary
ConstructorsConstructorDescriptionCommandCost
(String command, double cost) Used within Cost manager to track a new commands Cost -
Method Summary
Modifier and TypeMethodDescriptiondouble
getCost()
boolean
hasBalance
(org.bukkit.entity.Player player) boolean
runCommand
(org.bukkit.entity.Player player) Run when a player runs the command to subtract the cost of the command
-
Constructor Details
-
CommandCost
Used within Cost manager to track a new commands Cost- Parameters:
command
- the reference for the commandcost
- how long of a Cost that command has (in seconds)
-
-
Method Details
-
runCommand
public boolean runCommand(org.bukkit.entity.Player player) Run when a player runs the command to subtract the cost of the command- Parameters:
player
- the player to add a Cost for- Returns:
- If the player can run the command (if the transaction is a success or failure)
-
hasBalance
public boolean hasBalance(org.bukkit.entity.Player player) - Parameters:
player
- the player to check for- Returns:
- if a player has the money to run that command (to check before executing the command)
-
getCost
public double getCost() -
getCommand
-