Class GameEngine

java.lang.Object
com.valhalla.sdk.api.GameEngine

public final class GameEngine extends Object
Compile-time API surface. Implementations are supplied by the Android payload.
  • Method Details

    • getLocalPlayer

      public static LocalPlayer getLocalPlayer()
      Returns the current local-player snapshot.
      Returns:
      the current local-player snapshot
    • getCapabilities

      public static Set<String> 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 -1 when unavailable.
      Returns:
      the active world number, or -1 when unavailable
    • getPlayers

      public static List<Player> getPlayers()
      Returns visible player snapshots.
      Returns:
      visible player snapshots
    • getNpcs

      public static List<Npc> 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

      public static List<SceneObject> getGameObjects()
      Returns typed objects in the loaded scene.
      Returns:
      typed objects in the loaded scene
    • getGroundItems

      public static List<GroundItem> getGroundItems()
      Returns ground items in the loaded scene.
      Returns:
      ground items in the loaded scene
    • getInventoryItems

      public static List<Item> getInventoryItems()
      Returns items in occupied inventory slots.
      Returns:
      items in occupied inventory slots
    • getEquipmentItems

      public static List<Item> getEquipmentItems()
      Returns items in occupied equipment slots.
      Returns:
      items in occupied equipment slots
    • getWidgets

      public static List<Widget> getWidgets()
      Returns semantic widgets decoded by the active adapter.
      Returns:
      semantic widgets decoded by the active adapter
    • getCollisionMap

      public static Optional<CollisionMap> 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

      public static BankSnapshot getBankSnapshot()
      Returns the most recent bank state and item snapshot.
      Returns:
      the most recent bank state and item snapshot
    • bankAction

      public static boolean bankAction(String operation, int id, int amount, int slot, String text)
      Dispatches a bank operation.
      Parameters:
      operation - runtime bank-operation name
      id - target item identifier, or -1
      amount - requested amount
      slot - target slot, or -1
      text - optional operation text
      Returns:
      true when the runtime accepted the request
    • getSceneBase

      public static Tile getSceneBase()
      Returns the southwest tile of the loaded scene.
      Returns:
      the southwest tile of the loaded scene
    • isLoggedIn

      public static boolean isLoggedIn()
      Returns true when the native client reports an active game session.
      Returns:
      true when the native client reports an active game session
    • isActionReady

      public static boolean isActionReady()
      Returns true when the runtime can accept another native action.
      Returns:
      true when the runtime can accept another native action
    • isTileLoaded

      public static boolean isTileLoaded(Tile tile)
      Tests whether a tile is represented by the loaded scene.
      Parameters:
      tile - world tile to test
      Returns:
      true when the tile is loaded
    • interactObject

      public static boolean interactObject(int id, Tile tile, int action)
      Invokes a scene-object action.
      Parameters:
      id - object identifier
      tile - exact object tile
      action - zero-based menu-action index
      Returns:
      true when the runtime accepted the action
    • interactGroundItem

      public static boolean interactGroundItem(int id, Tile tile, int action)
      Invokes a ground-item action.
      Parameters:
      id - item identifier
      tile - exact item tile
      action - zero-based menu-action index
      Returns:
      true when the runtime accepted the action
    • interactNpc

      public static boolean interactNpc(int index, int action)
      Invokes an NPC action.
      Parameters:
      index - NPC scene index
      action - zero-based menu-action index
      Returns:
      true when the runtime accepted the action
    • walk

      public static boolean walk(Tile tile)
      Requests native movement toward a loaded tile.
      Parameters:
      tile - target world tile
      Returns:
      true when the runtime accepted the request
    • hopWorld

      public static boolean hopWorld(int world)
      Requests a world hop.
      Parameters:
      world - destination world number
      Returns:
      true when the runtime accepted the request
    • logout

      public static boolean logout()
      Returns true when the runtime accepted the logout request.
      Returns:
      true when 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:
      true when 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:
      true when 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 identifier
      slot - zero-based inventory slot
      action - zero-based menu-action index
      Returns:
      true when 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:
      true when the runtime accepted the action
    • cameraNorth

      public static boolean cameraNorth()
      Returns true when north-alignment was accepted.
      Returns:
      true when north-alignment was accepted