Link Search Menu Expand Document

Entity

An entity is the manifestation of an agent in a place.

The only fixed information in an entity is its id. Everything else is specified as a set of components.

Methods

entity:getParent ()

Gets the parent of a given Entity.

Arguments

None

Returns

Type Description
Entity The parent Entity, or nil if it has no parent.

entity:getAncestor ()

Gets the topmost parent of a given Entity. E g, if given a user’s hand, gets the root avatar for that user.

Arguments

None

Returns

Nothing


entity:getMatchingDescendant (The)

Finds the first descendant of self where calling predicate with each descendant returns true.

Arguments

Name Type Description
The Callback(entity):Bool predicate callback to run for each descendant

Returns

Type Description  
Entity nil the found entity, or nil if non found