Interface BuyGroup

All Superinterfaces:
Cloneable

public interface BuyGroup extends Cloneable
A BuyGroup is a system that allows a tier-like upgrading system in the shop
  • Method Details

    • getName

      String getName()
      Returns the name of this group.
      Returns:
      The name
    • getLevels

      Set<Integer> getLevels()
      Returns a set with all levels.
      Returns:
      A set with all added levels
    • getLowestLevel

      int getLowestLevel()
      Returns the lowest level of the getLevels() Set.

      This is also automatically the starting level.

      Returns:
      The lowest level of this group
    • getHighestLevel

      int getHighestLevel()
      Returns the highest level of the getLevels() Set.

      The max level the player can purchase.

      Returns:
      The highest level of this group
    • getItems

      @Nullable @Nullable Collection<? extends ShopItem> getItems(int level)
      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 using clone()).

      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: