Interface UpgradeState


public interface UpgradeState
Holds all the information regarding team upgrades.
  • 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

      int getCurrentLevel(Upgrade upgrade)
      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

      @Nullable @Nullable UpgradeLevel getCurrentUpgradeLevel(Upgrade upgrade)
      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

      UpgradeLevel getNextUpgradeLevel(Upgrade upgrade)
      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

      boolean isMaxLevel(Upgrade upgrade)
      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

      boolean doUpgrade(UpgradeLevel level, Player player)
      Runs an upgrade for a team.
      Parameters:
      level - The UpgradeLevel we will attempt to apply
      player - The player who ran the upgrade
      Returns:
      Whether the upgrade was successfully
    • queueTrap

      boolean queueTrap(UpgradeLevel level, boolean force)
      Adds a trap to the queue.
      Parameters:
      level - The trap we are adding to the queue
      force - 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

      void triggerTrap(Player player, Team baseTeam, boolean force)
      Triggers a trap at a certain base.
      Parameters:
      player - The player who triggered the trap
      baseTeam - The team that will have a trap trigger
      force - If we should bypass the trigger cool down