Interface Upgrade
public interface Upgrade
Represents a type of upgrade that holds all possible levels to which one may upgrade to
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enum
Represents the current upgrade state of a player -
Method Summary
Modifier and TypeMethodDescriptiongetId()
The id used in the config for this upgrade@Nullable UpgradeLevel
getLevel
(int level) Gets the upgrade levels at a certain levelReturns all UpgradeLevels attached to this upgradeReturns the maximum level in this upgradeReturns the first level of this upgrade@Nullable ArenaConditionGroup
The ArenaConditionGroup that controls what arenas this Upgrade is visible in.Returns the current state of a player that indicates whether he is able to upgrade at this given moment.boolean
isApplicable
(Arena arena) Get whether this upgrade can even be applied to the given arenaboolean
Weather or not this upgrade auto-scales its pricing.boolean
Weather or not this upgrade is repeatable.void
setRestriction
(@Nullable ArenaConditionGroup restriction) Lets you restrict this Upgrade, so only be available in certain arenas
-
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
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
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
Get whether this upgrade can even be applied to the given arenaOnly case where it's not applicable is if
getRestriction()
is notnull
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
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
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 upgradearena
- The arena the player is trying to buy the upgrade inteam
- The team the player is trying to buy the upgrade for- Returns:
- The state for this specific case
-