Interface Upgrade


public interface Upgrade
Represents a type of upgrade that holds all possible levels to which one may upgrade to
  • Method Details

    • getId

      String getId()
      The id used in the config for this upgrade
      Returns:
      the upgrade's id
    • isRepeatable

      boolean isRepeatable()
      Weather or not this upgrade is repeatable. Repeatable upgrades typically only have one upgrade level that can be purchased repeatedly
      Returns:
      whether the upgrade is repeatable
    • isPriceAutoScaling

      boolean isPriceAutoScaling()
      Weather or not this upgrade auto-scales its pricing. Price auto scaling only works if an upgrade is also a repeatable upgrade.
      Returns:
      whetherthe upgrade's price auto scales
    • getRestriction

      @Nullable @Nullable ArenaConditionGroup getRestriction()
      The ArenaConditionGroup that controls what arenas this Upgrade is visible in.
      Returns:
      The condition that states the arenas this Upgrade will be available in. null if the Upgrade should be displayed in every arena.
    • setRestriction

      void setRestriction(@Nullable @Nullable ArenaConditionGroup restriction)
      Lets you restrict this Upgrade, so only be available in certain arenas
      Parameters:
      restriction - The condition that states the arenas this Upgrade will be available in. null if the Upgrade should be displayed in every arena.
    • isApplicable

      boolean isApplicable(Arena arena)
      Get whether this upgrade can even be applied to the given arena

      Only case where it's not applicable is if getRestriction() is not null and the arena does not match the condition

      Parameters:
      arena - the arena to check
      Returns:
      true if the upgrade can be applied to the arena, false otherwise
    • getLevel

      @Nullable @Nullable UpgradeLevel getLevel(int level)
      Gets the upgrade levels at a certain level
      Parameters:
      level - what level you are trying to get
      Returns:
      Gets the upgrade level
    • getLevels

      List<UpgradeLevel> getLevels()
      Returns all UpgradeLevels attached to this upgrade
      Returns:
      returns all UpgradeLevels for this upgrade
    • getMinLevel

      UpgradeLevel getMinLevel()
      Returns the first level of this upgrade
      Returns:
      the first level of this upgrade
    • getMaxLevel

      UpgradeLevel getMaxLevel()
      Returns the maximum level in this upgrade
      Returns:
      the maximum level of this upgrade
    • getState

      Upgrade.State getState(Player player, Arena arena, Team team)
      Returns the current state of a player that indicates whether he is able to upgrade at this given moment.
      Parameters:
      player - The player looking to buy the upgrade
      arena - The arena the player is trying to buy the upgrade in
      team - The team the player is trying to buy the upgrade for
      Returns:
      The state for this specific case