Interface Upgrade
public interface Upgrade
Represents a type of upgrade that holds all possible levels to which one may upgrade to
-
Nested Class Summary
Modifier 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 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
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.
-
getLevel
Gets the upgrade levels at a certain level- Parameters:
level
- what level you are trying to get- Returns:
- Gets the upgrade level
-
getLevels
Set<UpgradeLevel> getLevels()Returns all UpgradeLevels attached to this upgrade- Returns:
- returns all UpgradeLevels for 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
-