Package com.valhalla.sdk.api.entities
Class Player
java.lang.Object
com.valhalla.sdk.api.entities.Player
Immutable snapshot of one player from the current native world view.
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a player snapshot without decoded route steps.Creates a player snapshot with a defensive copy of its walking queue. -
Method Summary
Modifier and TypeMethodDescriptionbooleanintgetIndex()Returns the current scene index.getName()Returns the captured display name.Returns the first queued step that differs from the current tile.getTile()Returns the captured world location.Returns the final queued destination when it differs from the current tile.Returns the captured walking queue.inthashCode()booleanisLocal()Reports whether this is the local player.booleanisMoving()Returns the captured movement state.toString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.valhalla.sdk.api.entities.Locatable
canReach, canReach, distance, distanceTo, getGridX, getGridY, getPlane, getRegionId, getX, getY, getZ, isInArea, isWithinDistance, walkingDistance
-
Constructor Details
-
Player
Creates a player snapshot without decoded route steps.- Parameters:
index- current scene indexname- captured display name, possibly blanktile- current world tilemoving- whether the native client reported movementlocal- whether this snapshot represents the local player
-
Player
public Player(int index, String name, Tile tile, boolean moving, boolean local, List<Tile> walkingQueue) Creates a player snapshot with a defensive copy of its walking queue.- Parameters:
index- current scene indexname- captured display name, possibly blanktile- current world tilemoving- whether the native client reported movementlocal- whether this snapshot represents the local playerwalkingQueue- ordered route steps captured from the client
-
-
Method Details
-
getIndex
public int getIndex()Returns the current scene index. -
getName
Returns the captured display name. -
getTile
Returns the captured world location. -
isMoving
public boolean isMoving()Returns the captured movement state.- Returns:
- whether movement was active when this snapshot was captured
-
isLocal
public boolean isLocal()Reports whether this is the local player.- Returns:
- whether this snapshot represents the local player
-
getWalkingQueue
Returns the captured walking queue.- Returns:
- immutable ordered walking queue captured from the client
-
getWalkingDestination
Returns the final queued destination when it differs from the current tile.- Returns:
- destination, or empty when no meaningful route is queued
-
getNextStep
Returns the first queued step that differs from the current tile.- Returns:
- next route step, or empty when none remains
-
equals
-
hashCode
public int hashCode() -
toString
-