Class Reward

java.lang.Object
com.ordwen.odailyquests.rewards.Reward

public class Reward extends Object
  • Constructor Details

    • Reward

      public Reward(RewardType rewardType, List<String> commands, String message)
      Constructor for a reward with a command.
      Parameters:
      commands - the reward-command.
    • Reward

      public Reward(RewardType rewardType, double amount, String message)
      Constructor for other reward.
      Parameters:
      amount - the reward amount.
    • Reward

      public Reward(RewardType rewardType, double minAmount, double maxAmount, String message)
      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

      public List<String> 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

      public String getRewardCurrency()
      Get the currency of a reward.
      Returns:
      the currency to give.
    • getRewardCurrencyDisplayName

      public String getRewardCurrencyDisplayName()
      Get the currency display name of a reward.
      Returns:
      the currency display name to give.
    • getRewardType

      public RewardType getRewardType()
      Get the reward type of reward.
      Returns:
      reward-type.
    • getMessage

      public String getMessage()
      Get the message of a reward.
      Returns:
      the message to send to the player.