Flecs: include/flecs/addons/cpp/mixins/alerts/builder.hpp Source File
Description: A fast entity component system (ECS) for C & C++

| Flecs v4.1 A fast entity component system (ECS) for C & C++

Loading...
Searching...
No Matches
builder.hpp
Go to the documentation of this file.
1
5
6#pragma once
7
8#include "../../utils/builder.hpp"
9#include "builder_i.hpp"
10
11namespace flecs {
12namespace _ {
13 template <typename ... Components>
14 using alert_builder_base = builder<
15 alert, ecs_alert_desc_t, alert_builder<Components...>,
16 alert_builder_i, Components ...>;
17}
18
23template <typename ... Components>
24 struct alert_builder final : _::alert_builder_base<Components...> {
25 alert_builder(flecs::world_t* world, const char *name = nullptr)
26 : _::alert_builder_base<Components...>(world)
27 {
28 _::sig<Components...>(world).populate(this);
29 if (name != nullptr) {
30 ecs_entity_desc_t entity_desc = {};
31 entity_desc.name = name;
32 entity_desc.sep = "::";
33 entity_desc.root_sep = "::";
34 this->desc_.entity = ecs_entity_init(world, &entity_desc);
35 }
36 }
37};
38
39}
builder_i.hpp
Alert builder interface.
ecs_alert_desc_t
struct ecs_alert_desc_t ecs_alert_desc_t
Alert descriptor, used with ecs_alert_init().
flecs::world_t
ecs_world_t world_t
World type.
Definition c_types.hpp:18
ecs_entity_init
ecs_entity_t ecs_entity_init(ecs_world_t *world, const ecs_entity_desc_t *desc)
Find or create an entity.
flecs::_
Int to enum.
Definition component.hpp:18
ecs_entity_desc_t
Used with ecs_entity_init().
Definition flecs.h:1046
ecs_entity_desc_t::sep
const char * sep
Optional custom separator for hierarchical names.
Definition flecs.h:1058
ecs_entity_desc_t::root_sep
const char * root_sep
Optional, used for identifiers relative to the root.
Definition flecs.h:1062
ecs_entity_desc_t::name
const char * name
Name of the entity.
Definition flecs.h:1053
flecs::_::builder
Definition builder.hpp:19
flecs::_::sig
Definition signature.hpp:38
flecs::term_ref_builder_i::name
Base & name(const char *name)
Specify the value of the identifier by name.
Definition builder_i.hpp:58
flecs::world
The world.
Definition world.hpp:246
flecs::world::alert
flecs::alert_builder< Comps... > alert(Args &&... args) const
Create an alert.
builder.hpp
Builder base class.