Package de.marcely.bedwars.api.game.shop
Interface BuyGroup
- All Superinterfaces:
Cloneable
A BuyGroup is a system that allows a tier-like upgrading system in the shop
-
Method Summary
Modifier and TypeMethodDescriptionclone()
Returns a clone of this instance.int
Returns the highest level of thegetLevels()
Set.@Nullable Collection
<? extends ShopItem> getItems
(int level) Returns a map with all items at that level.Returns a set with all levels.int
Returns the lowest level of thegetLevels()
Set.getName()
Returns the name of this group.Returns the original "non-cloned" instance.boolean
isClone()
Checks whether this instance is a clone (as if it has been cloned usingclone()
).boolean
Whether items shall be displayed as a single one in the shop GUI.void
setStacked
(boolean stacked) Define whether items shall be displayed as a single one in the shop GUI.
-
Method Details
-
getName
String getName()Returns the name of this group.- Returns:
- The name
-
getLevels
Returns a set with all levels.- Returns:
- A set with all added levels
-
getLowestLevel
int getLowestLevel()Returns the lowest level of thegetLevels()
Set.This is also automatically the starting level.
- Returns:
- The lowest level of this group
-
getHighestLevel
int getHighestLevel()Returns the highest level of thegetLevels()
Set.The max level the player can purchase.
- Returns:
- The highest level of this group
-
getItems
Returns a map with all items at that level.- Parameters:
level
- The level on which we're checking it- Returns:
- A collection with all items on that level in this buy group
-
isStacked
boolean isStacked()Whether items shall be displayed as a single one in the shop GUI.If
true
, then only the item that the player can buy on the given level will be shown.- Returns:
- Whether the items shall be stacked in the shop GUI
-
setStacked
void setStacked(boolean stacked) Define whether items shall be displayed as a single one in the shop GUI.If
true
, then only the item that the player can buy on the given level will be shown.- Parameters:
stacked
-true
if the items be stacked in the shop GUI
-
isClone
boolean isClone()Checks whether this instance is a clone (as if it has been cloned usingclone()
).BuyGroups are cloned in some cases (e.g. when a shop is opened) to allow you to modify the shop without affecting other arenas.
- Returns:
- whether this BuyGroup is a clone
- See Also:
-
getOriginal
BuyGroup getOriginal()Returns the original "non-cloned" instance.This will return the original instance from which the clone has been created from. In case
isClone()
returns false, the same instance is being returned.- Returns:
- The original non-cloned instance
- See Also:
-
clone
BuyGroup clone()Returns a clone of this instance.- Returns:
- A clone of this instance
- See Also:
-