jecs/docs/api/jecs.md
EncodedVenom 27b58e9745
Update jecs.md
Makes the sentence clearer
2025-03-30 12:24:24 -04:00

1.3 KiB

Jecs

Jecs. Just an Entity Component System.

Properties

World

jecs.World: World

A world is a container of all ECS data. Games can have multiple worlds but component IDs may conflict between worlds. Ensure to register the same component IDs in the same order for each world.

Wildcard

jecs.Wildcard: Entity

Builtin component type. This ID is used for wildcard queries.

Component

jecs.Component: Entity

Builtin component type. Every ID created with world:component() has this type added to it. This is meant for querying every component ID.

ChildOf

jecs.ChildOf: Entity

Builtin component type. This ID is for creating parent-child hierarchies.

Rest

jecs.Rest: Entity

Functions

pair()

function jecs.pair(
    first: Entity, -- The first element of the pair, referred to as the relationship of the relationship pair.
    object: Entity, -- The second element of the pair, referred to as the target of the relationship pair.
): number -- Returns the ID with those two elements

::: info

While relationship pairs can be used as components and have data associated with an ID, they cannot be used as entities. Meaning you cannot add components to a pair as the source of a binding.

:::