Function ecs_term_is_trivial

Synopsis

#include <include/flecs.h>

FLECS_API bool ecs_term_is_trivial(const ecs_term_t *term)

Description

Test whether a term is a trivial term. A trivial term is a term that only contains a type id. Trivial terms must not have read/write annotations, relation substitutions and subjects other than 'This'. Examples of trivial terms are:

  • 'Position'
  • 'Position(This)'
  • '(Likes, IceCream)'
  • 'Likes(This, IceCream)'

Examples of non-trivial terms are:

  • '[in] Position'
  • 'Position(MyEntity)'
  • 'Position(self|superset)'

Trivial terms are useful in expressions that should just represent a list of components, such as when parsing the list of components to add to an entity.

The term passed to this operation must be finalized. Terms returned by the parser are guaranteed to be finalized.

Parameters

term - The term.

Returns
True if term is trivial, false if it is not.

Source

Line 2371 in include/flecs.h.