Record Class Projectile

java.lang.Object
java.lang.Record
com.botwithus.bot.api.snapshot.Projectile
Record Components:
projectileId - graphic (spot-anim) id of the projectile
startCycle - game cycle the projectile was launched
endCycle - game cycle it lands
sourceIndex - server index of the source entity; -1 if tile-anchored
sourceType - source entity-type tag (raw passthrough from the engine)
targetIndex - server index of the target entity; -1 if tile target
targetType - target entity-type tag (raw passthrough from the engine)
startTileX - absolute world tile X of the launch point
startTileY - absolute world tile Y of the launch point
endTileX - absolute world tile X of the target point
endTileY - absolute world tile Y of the target point
plane - 0..3

public record Projectile(int projectileId, int startCycle, int endCycle, int sourceIndex, int sourceType, int targetIndex, int targetType, int startTileX, int startTileY, int endTileX, int endTileY, int plane) extends Record
Snapshot of one in-flight projectile at the producer's current tick (v17+).

Rows come from the producer's projectile-list walk; every active projectile (a thrown spell/arrow graphic travelling source→target) is emitted. Consumers filter on the immutable snapshot.

An endpoint is either an entity or a fixed tile: when sourceIndex() (resp. targetIndex()) is -1 the corresponding end is a tile, given by startTileX()/startTileY() (resp. endTileX()/endTileY()). sourceType() / targetType() are the engine's raw entity-type tags, surfaced unmodified for the consumer to interpret.

  • Constructor Summary

    Constructors
    Constructor
    Description
    Projectile(int projectileId, int startCycle, int endCycle, int sourceIndex, int sourceType, int targetIndex, int targetType, int startTileX, int startTileY, int endTileX, int endTileY, int plane)
    Creates an instance of a Projectile record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns the value of the endCycle record component.
    int
    Returns the value of the endTileX record component.
    int
    Returns the value of the endTileY record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    int
    Returns the value of the plane record component.
    int
    Returns the value of the projectileId record component.
    int
    Returns the value of the sourceIndex record component.
    int
    Returns the value of the sourceType record component.
    int
    Returns the value of the startCycle record component.
    int
    Returns the value of the startTileX record component.
    int
    Returns the value of the startTileY record component.
    int
    Returns the value of the targetIndex record component.
    int
    Returns the value of the targetType record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class Object

    getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Projectile

      public Projectile(int projectileId, int startCycle, int endCycle, int sourceIndex, int sourceType, int targetIndex, int targetType, int startTileX, int startTileY, int endTileX, int endTileY, int plane)
      Creates an instance of a Projectile record class.
      Parameters:
      projectileId - the value for the projectileId record component
      startCycle - the value for the startCycle record component
      endCycle - the value for the endCycle record component
      sourceIndex - the value for the sourceIndex record component
      sourceType - the value for the sourceType record component
      targetIndex - the value for the targetIndex record component
      targetType - the value for the targetType record component
      startTileX - the value for the startTileX record component
      startTileY - the value for the startTileY record component
      endTileX - the value for the endTileX record component
      endTileY - the value for the endTileY record component
      plane - the value for the plane record component
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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. All components in this record class are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • projectileId

      public int projectileId()
      Returns the value of the projectileId record component.
      Returns:
      the value of the projectileId record component
    • startCycle

      public int startCycle()
      Returns the value of the startCycle record component.
      Returns:
      the value of the startCycle record component
    • endCycle

      public int endCycle()
      Returns the value of the endCycle record component.
      Returns:
      the value of the endCycle record component
    • sourceIndex

      public int sourceIndex()
      Returns the value of the sourceIndex record component.
      Returns:
      the value of the sourceIndex record component
    • sourceType

      public int sourceType()
      Returns the value of the sourceType record component.
      Returns:
      the value of the sourceType record component
    • targetIndex

      public int targetIndex()
      Returns the value of the targetIndex record component.
      Returns:
      the value of the targetIndex record component
    • targetType

      public int targetType()
      Returns the value of the targetType record component.
      Returns:
      the value of the targetType record component
    • startTileX

      public int startTileX()
      Returns the value of the startTileX record component.
      Returns:
      the value of the startTileX record component
    • startTileY

      public int startTileY()
      Returns the value of the startTileY record component.
      Returns:
      the value of the startTileY record component
    • endTileX

      public int endTileX()
      Returns the value of the endTileX record component.
      Returns:
      the value of the endTileX record component
    • endTileY

      public int endTileY()
      Returns the value of the endTileY record component.
      Returns:
      the value of the endTileY record component
    • plane

      public int plane()
      Returns the value of the plane record component.
      Returns:
      the value of the plane record component