YaEntity¶
YaEntity
identifies an object in games.Functions¶
number GetEntityId()¶
ReturnsThe ID number
Get the entity ID for the entity.
1 2 |
|
boolean IsEmpty()¶
ReturnsTrue if the entity value represents no entity
Checks whether the entity value represents an entity.
Some APIs can return an entity that is empty (e.g., physics query APIs).
In that case, use this API to check the result.
1 2 3 4 5 6 7 |
|
boolean IsAlive()¶
ReturnsFalse if the entity value represents an eliminated entity or an empty entity, otherwise true
Checks whether the entity value represents an existing entity (different from the idea of method IsEmpty
).
If an entity value is stored for latter usage, this method can help check whether the entity still exists (if users are not sure about the existence).
Empty entities always not alive.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
|
YaEntity YaEntity.GetEntityById(number entityId)¶
ReturnsThe corresponding entity
Get the entity by the entity ID.
Under the case the entity does not exist, the IsEmpty
method would return true.
entityId
The entity ID that was retrieve by theYaEntity.EntityId field