Interface UpgradeShopLayoutHandler.OpenEvent
- Enclosing interface:
UpgradeShopLayoutHandler
public static interface UpgradeShopLayoutHandler.OpenEvent
Used to pass information to
UpgradeShopLayoutHandler.build(OpenEvent)
-
Method Summary
Modifier and TypeMethodDescriptionbuild
(UpgradeLevel upgradeLevel) Builds a GUIItem that can be used to set the upgrade inside the GUIbuild
(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@Nullable Arena
getArena()
Returns the arena the player is a part of.getData()
The default value is null<T> T
getData
(T def) Returns data that can be used during the sessionReturns the title that has been configured by the player.
That title shall be used when creating the GUIReturns the layout that has been openedReturns the player that opened itReturns the already loaded and ready to use player properties instance of the playerGets all the upgrade levels that should be displayed in the GUIReturns the upgrade state corresponding to the team this gui is selling upgrades for.getUpgradeState
(Upgrade upgrade) returns the upgrade state of a specified upgradevoid
refresh()
Will reopen the current GUIvoid
Will reopen the current GUI
-
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
-
getArena
Returns the arena the player is a part of.- Returns:
- The arena of the player. May be
null
of he's in none
-
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
-
getUpgradeState
UpgradeState getUpgradeState()Returns the upgrade state corresponding to the team this gui is selling upgrades for.May construct a fake instance in case the player is not within an arena or team.
- Returns:
- The current upgrade still
-
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
Will reopen the current GUI- Parameters:
data
- new data
-
getUpgradeState
returns the upgrade state of a specified upgrade- Parameters:
upgrade
- the upgrade we are checking- Returns:
- the current UpgradeState
-
build
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
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 fordata
- new data passed to the shop layout when the upgrade level is purchases- Returns:
- The item that shall be placed inside the GUI
-