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

| 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
5
12 void emit(flecs::entity_t evt) const {
13 flecs::world(world_)
14 .event(evt)
15 .entity(id_)
16 .emit();
17}
18
25 void emit(flecs::entity evt) const;
26
33template <typename Evt, if_t<is_empty<Evt>::value> = 0>
34 void emit() const {
35 this->emit(_::type<Evt>::id(world_));
36}
37
44template <typename Evt, if_not_t<is_empty<Evt>::value> = 0>
45 void 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
60 void enqueue(flecs::entity_t evt) const {
61 flecs::world(world_)
62 .event(evt)
63 .entity(id_)
64 .enqueue();
65}
66
73 void enqueue(flecs::entity evt) const;
74
81template <typename Evt, if_t<is_empty<Evt>::value> = 0>
82 void enqueue() const {
83 this->enqueue(_::type<Evt>::id(world_));
84}
85
92template <typename Evt, if_not_t<is_empty<Evt>::value> = 0>
93 void 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::world::event
flecs::event_builder event(flecs::entity_t evt) const
Create a new event.
Definition impl.hpp:15
flecs::_::type
Definition flecs.hpp:39
flecs::entity_view::emit
void emit(flecs::entity_t evt) const
Emit event for entity.
Definition entity_view.inl:12
flecs::entity_view::enqueue
void enqueue() const
Enqueue event for entity.
Definition entity_view.inl:82
flecs::entity_view::emit
void emit() const
Emit event for entity.
Definition entity_view.inl:34
flecs::entity_view::enqueue
void enqueue(flecs::entity_t evt) const
Enqueue event for entity.
Definition entity_view.inl:60
flecs::entity_view::emit
void emit(flecs::entity evt) const
Emit event for entity.
flecs::entity_view::enqueue
void enqueue(const Evt &payload) const
Enqueue event with payload for entity.
Definition entity_view.inl:93
flecs::entity_view::enqueue
void enqueue(flecs::entity evt) const
Enqueue event for entity.
flecs::entity_view::emit
void emit(const Evt &payload) const
Emit event with payload for entity.
Definition entity_view.inl:45
flecs::entity
Entity.
Definition entity.hpp:30
flecs::event_builder_base::entity
Base & entity(flecs::entity_t e)
Set entity for which to emit event.
Definition builder.hpp:85
flecs::world
The world.
Definition world.hpp:158