Package com.ordwen.odailyquests.rewards
Class Reward
java.lang.Object
com.ordwen.odailyquests.rewards.Reward
-
Constructor Summary
ConstructorsConstructorDescriptionReward(RewardType rewardType, double minAmount, double maxAmount, String message) Constructor for a reward with a random amount range.Reward(RewardType rewardType, double amount, String message) Constructor for other reward.Reward(RewardType rewardType, String currencyLabel, String currencyDisplayName, double minAmount, double maxAmount, String message) Constructor for a CoinsEngine reward with a random amount range.Reward(RewardType rewardType, String currencyLabel, String currencyDisplayName, double amount, String message) Constructor for a reward that is using CoinsEngine.Reward(RewardType rewardType, String currencyLabel, String currencyDisplayName, int amount, String message) Constructor for a reward that is using CoinsEngine.Reward(RewardType rewardType, List<String> commands, String message) Constructor for a reward with a command. -
Method Summary
Modifier and TypeMethodDescriptiondoubleReturns the maximum amount of the reward range.Get the message of a reward.doubleReturns the minimum amount of the reward range.doubleGet the amount of a reward.Get the command of a reward.Get the currency of a reward.Get the currency display name of a reward.Get the reward type of reward.booleanReturns true if the reward amount is defined as a random range.doubleResolves the reward amount, returning a random value if a range is configured.
-
Constructor Details
-
Reward
Constructor for a reward with a command.- Parameters:
commands- the reward-command.
-
Reward
Constructor for other reward.- Parameters:
amount- the reward amount.
-
Reward
Constructor for a reward with a random amount range.- Parameters:
minAmount- the minimum reward amount (inclusive).maxAmount- the maximum reward amount (inclusive).
-
Reward
public Reward(RewardType rewardType, String currencyLabel, String currencyDisplayName, int amount, String message) Constructor for a reward that is using CoinsEngine.- Parameters:
currencyLabel- the reward-currency, by its name in the configuration.currencyDisplayName- the name of the currency that will be displayed to the player.amount- the reward amount.
-
Reward
public Reward(RewardType rewardType, String currencyLabel, String currencyDisplayName, double amount, String message) Constructor for a reward that is using CoinsEngine.- Parameters:
currencyLabel- the reward-currency, by its name in the configuration.currencyDisplayName- the name of the currency that will be displayed to the player.amount- the reward amount.
-
Reward
public Reward(RewardType rewardType, String currencyLabel, String currencyDisplayName, double minAmount, double maxAmount, String message) Constructor for a CoinsEngine reward with a random amount range.- Parameters:
minAmount- the minimum reward amount (inclusive).maxAmount- the maximum reward amount (inclusive).
-
-
Method Details
-
getRewardCommands
Get the command of a reward.- Returns:
- the command to perform.
-
getRewardAmount
public double getRewardAmount()Get the amount of a reward.- Returns:
- the quantity to give.
-
hasRandomAmount
public boolean hasRandomAmount()Returns true if the reward amount is defined as a random range.- Returns:
- true when the reward amount has a range, false otherwise.
-
getMinRewardAmount
public double getMinRewardAmount()Returns the minimum amount of the reward range.- Returns:
- the minimum amount, or the fixed amount if not random.
-
getMaxRewardAmount
public double getMaxRewardAmount()Returns the maximum amount of the reward range.- Returns:
- the maximum amount, or the fixed amount if not random.
-
resolveRewardAmount
public double resolveRewardAmount()Resolves the reward amount, returning a random value if a range is configured.- Returns:
- resolved reward amount.
-
getRewardCurrency
Get the currency of a reward.- Returns:
- the currency to give.
-
getRewardCurrencyDisplayName
Get the currency display name of a reward.- Returns:
- the currency display name to give.
-
getRewardType
Get the reward type of reward.- Returns:
- reward-type.
-
getMessage
Get the message of a reward.- Returns:
- the message to send to the player.
-