Interface UpgradeShopLayoutHandler.OpenEvent

Enclosing interface:
UpgradeShopLayoutHandler

public static interface UpgradeShopLayoutHandler.OpenEvent
Used to pass information to UpgradeShopLayoutHandler.build(OpenEvent)
  • Method Details

    • getLayout

      UpgradeShopLayout getLayout()
      Returns the layout that has been opened
      Returns:
      The layout
    • getPlayer

      Player getPlayer()
      Returns the player that opened it
      Returns:
      The player
    • getPlayerProperties

      PlayerProperties getPlayerProperties()
      Returns the already loaded and ready to use player properties instance of the player
      Returns:
      The PlayerProperties instance of the given player
    • getDefaultGUITitle

      String getDefaultGUITitle()
      Returns the title that has been configured by the player.
      That title shall be used when creating the GUI
      Returns:
      The title that shall be used in the GUI
    • getUpgradeLevels

      List<UpgradeLevel> getUpgradeLevels()
      Gets all the upgrade levels that should be displayed in the GUI
      Returns:
      All the upgrade levels that need to be displayed
    • getData

      Object getData()
      The default value is null
      Returns:
      Data that can be passed around
    • getData

      <T> T getData(T def)
      Returns data that can be used during the session
      Type Parameters:
      T - (Unsafe operation:) Automatically casts the intern data object to the given generic
      Parameters:
      def - The default value which will be taken if none is set
      Returns:
      Data that can be passed around
    • refresh

      void refresh()
      Will reopen the current GUI
    • refresh

      void refresh(Object data)
      Will reopen the current GUI
      Parameters:
      data - new data
    • getUpgradeState

      Upgrade.State getUpgradeState(Upgrade upgrade)
      returns the upgrade state of a specified upgrade
      Parameters:
      upgrade - the upgrade we are checking
      Returns:
      the current UpgradeState
    • build

      GUIItem build(UpgradeLevel upgradeLevel)
      Builds a GUIItem that can be used to set the upgrade inside the GUI
      Parameters:
      upgradeLevel - the UpgradeLevel this GUIItem will be responsible for
      Returns:
      The item that shall be placed inside the GUI
    • build

      GUIItem build(UpgradeLevel upgradeLevel, Object data)
      Builds a GUIItem that can be used to set the upgrade inside the GUI the data is only passed if the purchase was successful
      Parameters:
      upgradeLevel - the UpgradeLevel this GUIItem will be responsible for
      data - new data passed to the shop layout when the upgrade level is purchases
      Returns:
      The item that shall be placed inside the GUI