Class UpgradeSettings

java.lang.Object
dev.kitteh.factions.upgrade.UpgradeSettings

@AvailableSince("4.0.0") @NullMarked public final class UpgradeSettings extends Object
Settings for an upgrade.
  • Constructor Details

  • Method Details

    • findFlaw

      public @Nullable String findFlaw()
      Tests this setting for issues like levels not aligning or missing variables. Called during construction, but this method allows for testing deserialized objects.
      Returns:
      first flaw found or null if no flaws found
    • upgrade

      public Upgrade upgrade()
      Gets the associated upgrade.
      Returns:
      upgrade
    • valueAt

      public BigDecimal valueAt(UpgradeVariable variable, int level)
      Gets the value of a variable at a given level.
      Parameters:
      variable - variable
      level - level
      Returns:
      value of variable at level
    • maxLevel

      public int maxLevel()
      Gets the max level chosen in settings. Cannot exceed Upgrade.maxLevel().
      Returns:
      max level
    • startingLevel

      public int startingLevel()
      Gets the starting level for factions to begin at.
      Returns:
      starting level
    • costAt

      public BigDecimal costAt(int level)
      Gets the cost of the upgrade at a given level.
      Parameters:
      level - level
      Returns:
      cost at level