Package net.blueva.arcade.api.store
Interface StoreAPI<P,M>
public interface StoreAPI<P,M>
API for registering and managing store categories/items.
-
Method Summary
Modifier and TypeMethodDescriptiongetSelected(P player, String categoryId) Get the selected item id for a category.booleanisUnlocked(P player, String categoryId, String itemId) Check if an item is unlocked for a player.booleanopenCategory(P player, String categoryId) Open a specific category.booleanOpen the global store categories menu for the player.booleanOpen the store menu including module-specific categories.voidregisterCategory(StoreCategoryDefinition<M> category, List<StoreItemDefinition<M>> items) Register a category with its items.resolveSelected(P player, String categoryId) Get the effective selected item id, resolving random selections to a concrete unlocked item.booleanSelect an item for a player.booleanUnlock an item for a player.voidunregisterCategory(String categoryId) Unregister a category by its id.
-
Method Details
-
registerCategory
Register a category with its items.- Parameters:
category- Category definitionitems- Items available in the category
-
unregisterCategory
Unregister a category by its id.- Parameters:
categoryId- Category id
-
openStore
Open the global store categories menu for the player. -
openStore
Open the store menu including module-specific categories.- Parameters:
player- Player to open formoduleId- Module id to include module-specific categories
-
openCategory
Open a specific category. -
isUnlocked
Check if an item is unlocked for a player. -
unlock
Unlock an item for a player. -
select
Select an item for a player. -
getSelected
Get the selected item id for a category. -
resolveSelected
Get the effective selected item id, resolving random selections to a concrete unlocked item.- Parameters:
player- player to resolve forcategoryId- category id- Returns:
- the resolved item id, or null if none is available
-