New fluent APIs for C++ queries and systems, removed internal C ecs_new_* functions #393
SanderMertens
started this conversation in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
New builder APIs
New builder classes have been added to the C++ API. These functions allow for the construction of queries and systems without having to use query strings, while retaining the same level of expressiveness. An example:
More complex queries are possible as well, such as selecting components from parent entities:
It is possible to augment existing template parameters, which allows for using
each()
in more scenarios:The same API is available for queries, using the
query_builder
function:A more thorough description of the possibilities will be added to the docs.
Introduction of ecs_system_init
Systems have just joined the rest of the API and can now be constructed with the
ecs_system_init
operation:Removal of ecs_new_* functions
The
ecs_new_*
functions such asecs_new_entity
,ecs_new_system
,ecs_new_component
etc have been removed. While these functions were always intended to be internal, some projects have used them in absence of easy to use non-macro alternatives.Code that uses these functions should be migrated to use
ecs_*_init
functions, such asecs_entity_init
,ecs_system_init
,ecs_component_init
etc. See the documentation in the header for more details.Beta Was this translation helpful? Give feedback.
All reactions