Interface UpgradeState
public interface UpgradeState
Holds all the information regarding team upgrades.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Clears the trap queue.boolean
doUpgrade
(UpgradeLevel level, Player player) Runs an upgrade for a team.The upgrade levels that currently effect the team.getArena()
Returns the arena belonging to this state.int
getCurrentLevel
(Upgrade upgrade) Returns the level this team has upgraded this upgrade to.@Nullable UpgradeLevel
getCurrentUpgradeLevel
(Upgrade upgrade) Returns the UpgradeLevel the teams has reached on this upgrade.getNextUpgradeLevel
(Upgrade upgrade) Returns the next upgrade level players can buy of the specified type.The traps currently queued for this team.getTeam()
The team that belongs to this state.boolean
isMaxLevel
(Upgrade upgrade) Checks if an upgrade is maxed out.boolean
queueTrap
(UpgradeLevel level, boolean force) Adds a trap to the queue.void
triggerTrap
(Player player, Team baseTeam, boolean force) Triggers a trap at a certain base.
-
Method Details
-
getArena
Arena getArena()Returns the arena belonging to this state.- Returns:
- The arena attached to this state
-
getTeam
Team getTeam()The team that belongs to this state.- Returns:
- The team attached to this state
-
getCurrentLevel
Returns the level this team has upgraded this upgrade to.- Parameters:
upgrade
- The upgrade we are checking- Returns:
- The level (how much) this upgrade has been upgraded to
-
getCurrentUpgradeLevel
Returns the UpgradeLevel the teams has reached on this upgrade.- Parameters:
upgrade
- The upgrade we are checking- Returns:
- The UpgradeLevel this upgrade is at, or
null
if it has not been upgraded
-
getNextUpgradeLevel
Returns the next upgrade level players can buy of the specified type.Can be the same as the current level if it is maxed out.
- Parameters:
upgrade
- The upgrade we are checking- Returns:
- The next upgrade level players can buy
-
isMaxLevel
Checks if an upgrade is maxed out.- Parameters:
upgrade
- The upgrade we are checking- Returns:
- If the upgrade is maxed out
-
getActiveUpgrades
List<UpgradeLevel> getActiveUpgrades()The upgrade levels that currently effect the team.- Returns:
- All upgrades effecting the team
-
getQueuedTraps
List<UpgradeLevel> getQueuedTraps()The traps currently queued for this team.- Returns:
- The queued traps
-
doUpgrade
Runs an upgrade for a team.- Parameters:
level
- The UpgradeLevel we will attempt to applyplayer
- The player who ran the upgrade- Returns:
- Whether the upgrade was successfully
-
queueTrap
Adds a trap to the queue.- Parameters:
level
- The trap we are adding to the queueforce
- If the trap should be forced into the queue (it might be full)- Returns:
- Weather or not we were successful in adding it to the queue
-
clearTrapQueue
void clearTrapQueue()Clears the trap queue. -
triggerTrap
Triggers a trap at a certain base.- Parameters:
player
- The player who triggered the trapbaseTeam
- The team that will have a trap triggerforce
- If we should bypass the trigger cool down
-