Package net.blueva.arcade.api.setup
Interface GameSetupAPI
public interface GameSetupAPI
API for registering and executing game setup commands.
Modules use this to register their setup handlers during onLoad().
-
Method Summary
Modifier and TypeMethodDescriptioncompleteSetup(TabCompleteContext context) Get tab completion suggestions.<P,C, L> boolean executeSetup(SetupContext<P, C, L> context) Execute a setup command.getHandler(String gameId) Get registered handler for a game.Get all registered game IDs.booleanhasHandler(String gameId) Check if a game has a registered handler.voidregisterHandler(String gameId, GameSetupHandler handler) Register a setup handler for a game.voidunregisterHandler(String gameId) Unregister a setup handler for a game.
-
Method Details
-
registerHandler
Register a setup handler for a game. Should be called during module's onLoad().- Parameters:
gameId- Game ID from module.ymlhandler- The handler to register
-
unregisterHandler
Unregister a setup handler for a game. Called automatically when module is unloaded.- Parameters:
gameId- Game ID to unregister
-
getHandler
Get registered handler for a game.- Parameters:
gameId- Game ID- Returns:
- Handler or null if not registered
-
getRegisteredGames
Get all registered game IDs.- Returns:
- List of registered game IDs
-
hasHandler
Check if a game has a registered handler.- Parameters:
gameId- Game ID- Returns:
- true if handler is registered
-
executeSetup
Execute a setup command. Called by core command handler.- Parameters:
context- Command context- Returns:
- true if command was handled
-
completeSetup
Get tab completion suggestions. Called by core command handler.- Parameters:
context- Tab completion context- Returns:
- Tab completion result
-