Package com.kraken.api.core.interaction
Interface MenuActionResolver<T>
-
- Type Parameters:
T- The type of game entity this resolver handles (NPC, Widget, TileObject, etc.)
- All Known Implementing Classes:
BankItemMenuActionResolver,GroundItemMenuActionResolver,NpcMenuActionResolver,PlayerMenuActionResolver,TileObjectMenuActionResolver,WidgetMenuActionResolver
public interface MenuActionResolver<T>Strategy for resolving aResolvedMenuActionfor a specific entity type.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.Class<T>getEntityType()The entity type this resolver handles.java.util.Optional<ResolvedMenuAction>resolve(T entity, java.lang.String action)Resolves the appropriate menu action for the given entity and action string.
-
-
-
Method Detail
-
resolve
java.util.Optional<ResolvedMenuAction> resolve(T entity, java.lang.String action)
Resolves the appropriate menu action for the given entity and action string.- Parameters:
entity- The game entity to interact withaction- The action string (e.g. "Attack", "Talk-to", "Examine")- Returns:
- An Optional containing the resolved action, or empty if resolution failed
-
getEntityType
java.lang.Class<T> getEntityType()
The entity type this resolver handles. Used for registry lookup.- Returns:
- Class<T> The type of game entity this resolver handles (e.g. NPC, Widget, TileObject, etc.)
-
-