Class PlayerView
java.lang.Object
privbot.mechanics.PlayerView
One player reduced to what a PvP fight needs. Immutable.
What it proves: only that ctx.pvp.snapshot(..) read these values from a live player on one tick.
Unreadable looks like: every boxed accessor is null when its read failed, and a null is never a
negative answer. overhead() and skull() tell "nothing shown" apart from "unknown": they are
NONE ("NONE") when the read worked and no icon shows, and null only when it could not be
read. wornItemIds() is an empty list when the appearance was read and nothing is worn, and null
when the appearance could not be read.
Thread rule: pure value type, safe on any thread.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringoverhead()orskull()when the read worked and no icon shows. -
Constructor Summary
ConstructorsConstructorDescriptionPlayerView(String name, int index, Integer combatLevel, String overhead, String skull, Integer healthRatio, Integer healthScale, Integer animation, Integer graphic, List<Integer> wornItemIds, net.runelite.api.coords.WorldPoint tile, Boolean targetsUs, Integer interactingIndex) PlayerView(String name, int index, Integer combatLevel, String overhead, String skull, Integer healthRatio, Integer healthScale, Integer animation, Integer graphic, List<Integer> wornItemIds, net.runelite.api.coords.WorldPoint tile, Boolean targetsUs, Integer interactingIndex, Integer weaponId) As above; weaponId is the worn weapon's item ID, -1 for an empty slot, or null if unreadable.PlayerView(String name, int index, Integer combatLevel, String overhead, String skull, Integer healthRatio, Integer healthScale, Integer animation, Integer graphic, List<Integer> wornItemIds, net.runelite.api.coords.WorldPoint tile, Boolean targetsUs, Integer interactingIndex, Integer weaponId, String weaponName) As above, with the name resolved from the item definition, or null when unavailable. -
Method Summary
-
Field Details
-
NONE
overhead()orskull()when the read worked and no icon shows.- See Also:
-
-
Constructor Details
-
PlayerView
public PlayerView(String name, int index, Integer combatLevel, String overhead, String skull, Integer healthRatio, Integer healthScale, Integer animation, Integer graphic, List<Integer> wornItemIds, net.runelite.api.coords.WorldPoint tile, Boolean targetsUs, Integer interactingIndex) - Parameters:
name- the display name (tags removed), or null when unreadableindex- the player's index in the client's player array (Player.getId())combatLevel- the combat level, or null when unreadableoverhead- the overhead prayer icon's name,NONE, or null when unreadableskull- the skull icon's name,NONE, or null when unreadablehealthRatio- the HP bar fill, or null when unreadablehealthScale- the HP bar scale, or null when unreadableanimation- the current animation id (server ids), or null when unreadablegraphic- the current spot graphic id, or null when unreadablewornItemIds- the worn item ids (copied), empty when none are worn, null when unreadabletile- the player's tiletargetsUs- whether it interacts with the local player, or null when unreadableinteractingIndex- the player index it interacts with, -1 for an NPC or nothing, or null when unreadable
-
PlayerView
public PlayerView(String name, int index, Integer combatLevel, String overhead, String skull, Integer healthRatio, Integer healthScale, Integer animation, Integer graphic, List<Integer> wornItemIds, net.runelite.api.coords.WorldPoint tile, Boolean targetsUs, Integer interactingIndex, Integer weaponId) As above; weaponId is the worn weapon's item ID, -1 for an empty slot, or null if unreadable. -
PlayerView
public PlayerView(String name, int index, Integer combatLevel, String overhead, String skull, Integer healthRatio, Integer healthScale, Integer animation, Integer graphic, List<Integer> wornItemIds, net.runelite.api.coords.WorldPoint tile, Boolean targetsUs, Integer interactingIndex, Integer weaponId, String weaponName) As above, with the name resolved from the item definition, or null when unavailable.
-
-
Method Details
-
name
- Returns:
- the display name with tags removed, or null when unreadable
-
index
public int index()- Returns:
- the index in the client's player array (
Player.getId())
-
combatLevel
- Returns:
- the combat level, or null when unreadable
-
overhead
-
skull
-
healthRatio
- Returns:
- the HP bar fill, or null when unreadable
-
healthScale
- Returns:
- the HP bar scale, or null when unreadable
-
animation
- Returns:
- the current animation id in this server's ids, or null when unreadable
-
graphic
- Returns:
- the current spot graphic id, or null when unreadable
-
wornItemIds
-
weaponId
- Returns:
- weapon item id, -1 when the slot is empty, or null when it cannot be read
-
weaponName
- Returns:
- weapon name, or null when empty or the weapon or definition cannot be read
-
tile
public net.runelite.api.coords.WorldPoint tile()- Returns:
- the player's tile (the server tile on supported clients when it can be read)
-
targetsUs
- Returns:
- whether this player interacts with the local player, or null when unreadable
-
interactingIndex
- Returns:
- the player index it interacts with, -1 for an NPC or nothing, or null when unreadable
-
toString
-