Flecs v4.0
A fast entity component system (ECS) for C & C++
Loading...
Searching...
No Matches
entity_view.inl
Go to the documentation of this file.
1
12void emit(flecs::entity_t evt) const {
13 flecs::world(world_)
14 .event(evt)
15 .entity(id_)
16 .emit();
17}
18
25void emit(flecs::entity evt) const;
26
33template <typename Evt, if_t<is_empty<Evt>::value> = 0>
34void emit() const {
35 this->emit(_::type<Evt>::id(world_));
36}
37
44template <typename Evt, if_not_t<is_empty<Evt>::value> = 0>
45void emit(const Evt& payload) const {
46 flecs::world(world_)
47 .event(_::type<Evt>::id(world_))
48 .entity(id_)
49 .ctx(&payload)
50 .emit();
51}
52
53
60void enqueue(flecs::entity_t evt) const {
61 flecs::world(world_)
62 .event(evt)
63 .entity(id_)
64 .enqueue();
65}
66
73void enqueue(flecs::entity evt) const;
74
81template <typename Evt, if_t<is_empty<Evt>::value> = 0>
82void enqueue() const {
83 this->enqueue(_::type<Evt>::id(world_));
84}
85
92template <typename Evt, if_not_t<is_empty<Evt>::value> = 0>
93void enqueue(const Evt& payload) const {
94 flecs::world(world_)
95 .event(_::type<Evt>::id(world_))
96 .entity(id_)
97 .ctx(&payload)
98 .enqueue();
99}
flecs::event_builder event(flecs::entity_t evt) const
Create a new event.
void emit(flecs::entity_t evt) const
Emit event for entity.
void enqueue() const
Enqueue event for entity.
void emit() const
Emit event for entity.
void enqueue(flecs::entity_t evt) const
Enqueue event for entity.
void enqueue(const Evt &payload) const
Enqueue event with payload for entity.
void emit(const Evt &payload) const
Emit event with payload for entity.
Entity.
Definition entity.hpp:30
Base & entity(flecs::entity_t e)
Set entity for which to emit event.
Definition builder.hpp:85
The world.
Definition world.hpp:137