Flecs v4.0
A fast entity component system (ECS) for C & C++
Loading...
Searching...
No Matches
Observers

Observers let applications register callbacks for ECS events. More...

Collaboration diagram for Observers:

Classes

struct  flecs::observer_builder< Components >
 Observer builder. More...
 
struct  flecs::observer_builder_i< Base, Components >
 Observer builder interface. More...
 
flecs::observer flecs::world::observer (flecs::entity e) const
 Observer builder.
 
template<typename... Components, typename... Args>
flecs::observer_builder< Components... > observer (Args &&... args) const
 Create a new observer.
 

Detailed Description

Observers let applications register callbacks for ECS events.

Function Documentation

◆ observer() [1/2]

template<typename... Components, typename... Args>
flecs::observer_builder< Components... > observer ( Args &&... args) const
related

Create a new observer.

Template Parameters
ComponentsThe components to match on.
ArgsArguments passed to the constructor of flecs::observer_builder.
Returns
Observer builder.

◆ observer() [2/2]

Observer builder.

Upcast entity to an observer. The provided entity must be an observer.

Parameters
eThe entity.
Returns
An observer object.