Package games.pixscape.runtime.api
Interface EntitiesAPI
public interface EntitiesAPI
High-level entity identity access.
Use stableId as the preferred persistent/public identity.
entityId is runtime/ECS-oriented and may be short-lived or recycled.
-
Method Summary
Modifier and TypeMethodDescriptionvoidSchedules entity destruction through ECS deletion.voiddestroyEntityId(int entityId) Same semantics asdestroy(EntityRef)for a runtime entityId.voiddestroyStableId(int stableId) Same semantics asdestroy(EntityRef)for a stableId lookup.intensureStableId(int entityId) Ensures and returns a stableId for the runtimeentityId.intentityIdOf(int stableId) Resolves runtimeentityIdfromstableId, or-1when missing.booleanexistsEntityId(int entityId) booleanexistsStableId(int stableId) intfindEntityId(int stableId, int defaultValue) ofEntityId(int entityId) Returns a tolerant reference bound to the current incarnation of the provided runtimeentityId.ofStableId(int stableId) Returns a tolerant reference bound to the entity currently resolved from a persistent/publicstableId.requireEntityId(int entityId) Same asofEntityId(int)but throws when the entity does not exist at acquisition time.requireName(String name) Strictly resolves the entity currently indexed byname.requireStableId(int stableId) Same asofStableId(int)but throws when not found at acquisition time.requireTag(String tag) Strictly resolves the entity currently indexed bytag.intstableIdOf(int entityId) Resolves persistent/publicstableIdfrom runtimeentityId.
-
Method Details
-
ofEntityId
Returns a tolerant reference bound to the current incarnation of the provided runtimeentityId. An absent or later-stale reference is inert. -
ofStableId
Returns a tolerant reference bound to the entity currently resolved from a persistent/publicstableId. It does not follow later reuse or replacement. -
requireEntityId
Same asofEntityId(int)but throws when the entity does not exist at acquisition time. The returned reference can later become stale and inert. -
requireStableId
Same asofStableId(int)but throws when not found at acquisition time. The returned reference can later become stale and inert. -
requireTag
Strictly resolves the entity currently indexed bytag. The returned reference can later become stale and inert. -
requireName
Strictly resolves the entity currently indexed byname. The returned reference can later become stale and inert. -
entityIdOf
int entityIdOf(int stableId) Resolves runtimeentityIdfromstableId, or-1when missing. -
findEntityId
int findEntityId(int stableId, int defaultValue) -
stableIdOf
int stableIdOf(int entityId) Resolves persistent/publicstableIdfrom runtimeentityId. -
ensureStableId
int ensureStableId(int entityId) Ensures and returns a stableId for the runtimeentityId. -
existsEntityId
boolean existsEntityId(int entityId) -
existsStableId
boolean existsStableId(int stableId) -
destroy
Schedules entity destruction through ECS deletion.Effects become fully visible after the next normal world processing step (for example the next engine
render()call that processes the world). -
destroyEntityId
void destroyEntityId(int entityId) Same semantics asdestroy(EntityRef)for a runtime entityId. -
destroyStableId
void destroyStableId(int stableId) Same semantics asdestroy(EntityRef)for a stableId lookup.
-