Package com.valhalla.sdk.api
Class GameEngine
java.lang.Object
com.valhalla.sdk.api.GameEngine
Compile-time API surface. Implementations are supplied by the Android payload.
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanbankAction(String operation, int id, int amount, int slot, String text) Dispatches a bank operation.static booleanReturnstruewhen north-alignment was accepted.static BankSnapshotReturns the most recent bank state and item snapshot.Returns immutable names of features supported by the active native adapter.static Optional<CollisionMap> Returns the live collision map, or an empty value when it is unavailable.static intgetCurrentSkillLevel(int skillId) Reads a boost-aware skill level.static intReturns the active world number, or-1when unavailable.Returns items in occupied equipment slots.static List<SceneObject> Returns typed objects in the loaded scene.static List<GroundItem> Returns ground items in the loaded scene.Returns items in occupied inventory slots.static LocalPlayerReturns the current local-player snapshot.getNpcs()Returns visible NPC snapshots.Returns visible player snapshots.static intgetRealSkillLevel(int skillId) Reads an unboosted skill level.static TileReturns the southwest tile of the loaded scene.static intgetSkillExperience(int skillId) Reads accumulated skill experience.Returns semantic widgets decoded by the active adapter.static booleanhopWorld(int world) Requests a world hop.static booleaninteractEquipmentSlot(int slot) Invokes the default action for an equipment slot.static booleaninteractGroundItem(int id, Tile tile, int action) Invokes a ground-item action.static booleaninteractInventoryItem(int itemId, int slot, int action) Invokes an action on an inventory item.static booleaninteractInventorySlot(int slot) Invokes the default action for an inventory slot.static booleaninteractNpc(int index, int action) Invokes an NPC action.static booleaninteractObject(int id, Tile tile, int action) Invokes a scene-object action.static booleanReturnstruewhen the runtime can accept another native action.static booleanReturnstruewhen the native client reports an active game session.static booleanisTileLoaded(Tile tile) Tests whether a tile is represented by the loaded scene.static booleanlogout()Returnstruewhen the runtime accepted the logout request.static booleanopenTab(int tab) Opens a top-level game tab.static booleanRequests native movement toward a loaded tile.
-
Method Details
-
getLocalPlayer
Returns the current local-player snapshot.- Returns:
- the current local-player snapshot
-
getCapabilities
Returns immutable names of features supported by the active native adapter.- Returns:
- immutable names of features supported by the active native adapter
-
getCurrentWorld
public static int getCurrentWorld()Returns the active world number, or-1when unavailable.- Returns:
- the active world number, or
-1when unavailable
-
getPlayers
Returns visible player snapshots.- Returns:
- visible player snapshots
-
getNpcs
Returns visible NPC snapshots.- Returns:
- visible NPC snapshots
-
getCurrentSkillLevel
public static int getCurrentSkillLevel(int skillId) Reads a boost-aware skill level.- Parameters:
skillId- stable client skill identifier- Returns:
- the current level
-
getRealSkillLevel
public static int getRealSkillLevel(int skillId) Reads an unboosted skill level.- Parameters:
skillId- stable client skill identifier- Returns:
- the real level
-
getSkillExperience
public static int getSkillExperience(int skillId) Reads accumulated skill experience.- Parameters:
skillId- stable client skill identifier- Returns:
- experience points
-
getGameObjects
Returns typed objects in the loaded scene.- Returns:
- typed objects in the loaded scene
-
getGroundItems
Returns ground items in the loaded scene.- Returns:
- ground items in the loaded scene
-
getInventoryItems
Returns items in occupied inventory slots.- Returns:
- items in occupied inventory slots
-
getEquipmentItems
Returns items in occupied equipment slots.- Returns:
- items in occupied equipment slots
-
getWidgets
Returns semantic widgets decoded by the active adapter.- Returns:
- semantic widgets decoded by the active adapter
-
getCollisionMap
Returns the live collision map, or an empty value when it is unavailable.- Returns:
- the live collision map, or an empty value when it is unavailable
-
getBankSnapshot
Returns the most recent bank state and item snapshot.- Returns:
- the most recent bank state and item snapshot
-
bankAction
Dispatches a bank operation.- Parameters:
operation- runtime bank-operation nameid- target item identifier, or-1amount- requested amountslot- target slot, or-1text- optional operation text- Returns:
truewhen the runtime accepted the request
-
getSceneBase
Returns the southwest tile of the loaded scene.- Returns:
- the southwest tile of the loaded scene
-
isLoggedIn
public static boolean isLoggedIn()Returnstruewhen the native client reports an active game session.- Returns:
truewhen the native client reports an active game session
-
isActionReady
public static boolean isActionReady()Returnstruewhen the runtime can accept another native action.- Returns:
truewhen the runtime can accept another native action
-
isTileLoaded
Tests whether a tile is represented by the loaded scene.- Parameters:
tile- world tile to test- Returns:
truewhen the tile is loaded
-
interactObject
Invokes a scene-object action.- Parameters:
id- object identifiertile- exact object tileaction- zero-based menu-action index- Returns:
truewhen the runtime accepted the action
-
interactGroundItem
Invokes a ground-item action.- Parameters:
id- item identifiertile- exact item tileaction- zero-based menu-action index- Returns:
truewhen the runtime accepted the action
-
interactNpc
public static boolean interactNpc(int index, int action) Invokes an NPC action.- Parameters:
index- NPC scene indexaction- zero-based menu-action index- Returns:
truewhen the runtime accepted the action
-
walk
Requests native movement toward a loaded tile.- Parameters:
tile- target world tile- Returns:
truewhen the runtime accepted the request
-
hopWorld
public static boolean hopWorld(int world) Requests a world hop.- Parameters:
world- destination world number- Returns:
truewhen the runtime accepted the request
-
logout
public static boolean logout()Returnstruewhen the runtime accepted the logout request.- Returns:
truewhen the runtime accepted the logout request
-
openTab
public static boolean openTab(int tab) Opens a top-level game tab.- Parameters:
tab- native tab code- Returns:
truewhen the runtime accepted the request
-
interactInventorySlot
public static boolean interactInventorySlot(int slot) Invokes the default action for an inventory slot.- Parameters:
slot- zero-based inventory slot- Returns:
truewhen the runtime accepted the action
-
interactInventoryItem
public static boolean interactInventoryItem(int itemId, int slot, int action) Invokes an action on an inventory item.- Parameters:
itemId- expected item identifierslot- zero-based inventory slotaction- zero-based menu-action index- Returns:
truewhen the runtime accepted the action
-
interactEquipmentSlot
public static boolean interactEquipmentSlot(int slot) Invokes the default action for an equipment slot.- Parameters:
slot- native equipment-slot index- Returns:
truewhen the runtime accepted the action
-
cameraNorth
public static boolean cameraNorth()Returnstruewhen north-alignment was accepted.- Returns:
truewhen north-alignment was accepted
-