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 TypeMethodDescriptiondefault intdistanceTo(int x, int y) Chebyshev (king-move) distance to another tile — same metric the game itself uses for "within range" checks on actions.default intdistanceTo(EntityContext other) Distance to another entity.intplane()Plane / height level (0-3).inttileX()Absolute world tile X.inttileY()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
Distance to another entity.
-