Record Class Player
java.lang.Object
java.lang.Record
com.botwithus.bot.api.snapshot.Player
- Record Components:
serverIndex- server-side player slottileX- absolute world tile XtileY- absolute world tile Yplane-0..3flags- bitset; bit 0 = moving (seeisMoving())followingIndex- server index of the follow target, or-1animationId- current animation id, or-1stanceId- current stance idcombatLevel- combat level, or0if not computedspotAnimId- first active spot anim (graphic) id, or-1if none
public record Player(int serverIndex, int tileX, int tileY, int plane, int flags, int followingIndex, int animationId, int stanceId, int combatLevel, int spotAnimId, Orientation orientation)
extends Record
Snapshot of one player at the producer's current tick.
-
Constructor Summary
ConstructorsConstructorDescriptionPlayer(int serverIndex, int tileX, int tileY, int plane, int flags, int followingIndex, int animationId, int stanceId, int combatLevel, int spotAnimId) Builds a row with an unknown facing; kept so pre-v21 callers compile unchanged.Player(int serverIndex, int tileX, int tileY, int plane, int flags, int followingIndex, int animationId, int stanceId, int combatLevel, int spotAnimId, Orientation orientation) Creates an instance of aPlayerrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the value of theanimationIdrecord component.intReturns the value of thecombatLevelrecord component.final booleanIndicates whether some other object is "equal to" this one.intflags()Returns the value of theflagsrecord component.intReturns the value of thefollowingIndexrecord component.final inthashCode()Returns a hash code value for this object.booleanisMoving()Returns the value of theorientationrecord component.intplane()Returns the value of theplanerecord component.intReturns the value of theserverIndexrecord component.intReturns the value of thespotAnimIdrecord component.intstanceId()Returns the value of thestanceIdrecord component.inttileX()Returns the value of thetileXrecord component.inttileY()Returns the value of thetileYrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Player
public Player(int serverIndex, int tileX, int tileY, int plane, int flags, int followingIndex, int animationId, int stanceId, int combatLevel, int spotAnimId) Builds a row with an unknown facing; kept so pre-v21 callers compile unchanged. -
Player
public Player(int serverIndex, int tileX, int tileY, int plane, int flags, int followingIndex, int animationId, int stanceId, int combatLevel, int spotAnimId, Orientation orientation) Creates an instance of aPlayerrecord class.- Parameters:
serverIndex- the value for theserverIndexrecord componenttileX- the value for thetileXrecord componenttileY- the value for thetileYrecord componentplane- the value for theplanerecord componentflags- the value for theflagsrecord componentfollowingIndex- the value for thefollowingIndexrecord componentanimationId- the value for theanimationIdrecord componentstanceId- the value for thestanceIdrecord componentcombatLevel- the value for thecombatLevelrecord componentspotAnimId- the value for thespotAnimIdrecord componentorientation- the value for theorientationrecord component
-
-
Method Details
-
isMoving
public boolean isMoving() -
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
serverIndex
public int serverIndex()Returns the value of theserverIndexrecord component.- Returns:
- the value of the
serverIndexrecord component
-
tileX
-
tileY
-
plane
-
flags
-
followingIndex
public int followingIndex()Returns the value of thefollowingIndexrecord component.- Returns:
- the value of the
followingIndexrecord component
-
animationId
public int animationId()Returns the value of theanimationIdrecord component.- Returns:
- the value of the
animationIdrecord component
-
stanceId
-
combatLevel
public int combatLevel()Returns the value of thecombatLevelrecord component.- Returns:
- the value of the
combatLevelrecord component
-
spotAnimId
public int spotAnimId()Returns the value of thespotAnimIdrecord component.- Returns:
- the value of the
spotAnimIdrecord component
-
orientation
Returns the value of theorientationrecord component.- Returns:
- the value of the
orientationrecord component
-