CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
CeresEngine::ComponentListener< Cs > Struct Template Reference

The ComponentListener is a EntityManager listener type that gets notified whenever an entity matching a given mask() gets added or removed in the entity manager. More...

#include <CeresEngine/Entity/Component.hpp>

Inheritance diagram for CeresEngine::ComponentListener< Cs >:
CeresEngine::AbstractComponentListener

Public Member Functions

ComponentMask mask () const noexcept final
 The component criteria a entity must match for consideration of a callback.
 
- Public Member Functions inherited from CeresEngine::AbstractComponentListener
virtual ~AbstractComponentListener ()=default
 Destroys the AbstractComponentListener instance.
 
virtual void componentsAdded (const Entity &entity) noexcept=0
 A notification dispatched by the SystemManager to a system.
 
virtual void componentsRemoved (const Entity &entity) noexcept=0
 A notification dispatched by the SystemManager to a system.
 
virtual void entityDirtied (const Entity &entity, const EntityChangeSet &changeSet) noexcept
 A notification dispatched by the SystemManager to a system.
 

Detailed Description

template<CComponent... Cs>
struct CeresEngine::ComponentListener< Cs >

The ComponentListener is a EntityManager listener type that gets notified whenever an entity matching a given mask() gets added or removed in the entity manager.

The mask method is final overriden with the automatically generated mask of all components Cs as if ComponentSet<Cs...>::mask.

The componentsAdded notification is dispatched once a new entity matching the mask criteria is created (either by creating it or by adding all components required).

The componentsRemoved notification is dispatched once an entity that previously matched the mask criteria is destroyed (either by destroying it or by removing one of the required components).

Template Parameters
Csthe component types to listen for

Member Function Documentation

◆ mask()

template<CComponent... Cs>
ComponentMask CeresEngine::ComponentListener< Cs >::mask ( ) const
inlinefinalvirtualnoexcept

The component criteria a entity must match for consideration of a callback.

Returns
The component mask of the requirements

Implements CeresEngine::AbstractComponentListener.


The documentation for this struct was generated from the following file: