Interface EntityContext

All Known Implementing Classes:
GroundItem, Npc, Player, Projectile, SceneObject

public interface EntityContext
Shared surface for everything an EntityQuery can reason about without consulting an entity-specific definition. Position is the common denominator: it's needed for withinDistance and nearest sorting on every entity type, and it lives on the snapshot record so we can read it without any RPC.

Implementations are the rich wrapper classes (Npc, Player, future SceneObject, GroundItem) — the snapshot records themselves don't implement this; they're the data we wrap.

  • Method Summary

    Modifier and Type
    Method
    Description
    default int
    distanceTo(int x, int y)
    Chebyshev (king-move) distance to another tile — same metric the game itself uses for "within range" checks on actions.
    default int
    Distance to another entity.
    int
    Plane / height level (0-3).
    int
    Absolute world tile X.
    int
    Absolute world tile Y.
  • Method Details

    • tileX

      int tileX()
      Absolute world tile X.
    • tileY

      int tileY()
      Absolute world tile Y.
    • plane

      int plane()
      Plane / height level (0-3).
    • distanceTo

      default int distanceTo(int x, int y)
      Chebyshev (king-move) distance to another tile — same metric the game itself uses for "within range" checks on actions.
    • distanceTo

      default int distanceTo(EntityContext other)
      Distance to another entity.