Flecs v4.0
A fast entity component system (ECS) for C & C++
Loading...
Searching...
No Matches
builder.hpp
Go to the documentation of this file.
1
6#pragma once
7
9#include "builder_i.hpp"
10
11namespace flecs {
12namespace _ {
13 template <typename ... Components>
14 using system_builder_base = node_builder<
15 system, ecs_system_desc_t, system_builder<Components...>,
16 system_builder_i, Components ...>;
17}
18
23template <typename ... Components>
24struct system_builder final : _::system_builder_base<Components...> {
25 system_builder(flecs::world_t* world, const char *name = nullptr)
26 : _::system_builder_base<Components...>(world, name)
27 {
28 _::sig<Components...>(world).populate(this);
29
30#ifdef FLECS_PIPELINE
31 ecs_add_id(world, this->desc_.entity, ecs_dependson(flecs::OnUpdate));
32 ecs_add_id(world, this->desc_.entity, flecs::OnUpdate);
33#endif
34 }
35};
36
37}
void ecs_add_id(ecs_world_t *world, ecs_entity_t entity, ecs_id_t id)
Add a (component) id to an entity.
struct ecs_system_desc_t ecs_system_desc_t
Use with ecs_system_init() to create or update a system.
Base builder class for node objects, like systems, observers.
System builder.
Definition builder.hpp:24
The world.
Definition world.hpp:137
System builder interface.