111 virtual void didAdd(
const EO& entity)
noexcept = 0;
168 template<
typename T,
typename EntityObjects = EntityObjectSet<>,
typename Components = ComponentSet<>,
typename Actions = EntityActionSet<>>
class System;
171 template<
typename T,
typename...
EOs,
typename...
Cs,
typename...
As>
187 static inline const SystemID systemID = []()
noexcept {
188 static SystemID systemID = nextSystemID++;
201 template<
typename S>
constexpr bool isSystem = std::is_base_of<AbstractSystem, S>::value;
212 template<
typename T,
typename S>
using ifSystem =
typename std::enable_if<isSystem<S>,
T>::type;
231 template<
typename T,
typename...
EOs,
typename...
Cs,
typename...
As>
238 template<
typename T,
typename...
EOs,
typename...
Cs,
typename...
As>
#define CE_SCRIPT_EXPORT(...)
The CE_SCRIPT_EXPORT macro marks a class or method as exportable and available in scripting environme...
Definition Macros.hpp:247
A abstract class that provides a trait that allows checking for system implementations.
Definition System.hpp:35
static const SystemOrder defaultOrder
The default execution updating order for systems.
Definition System.hpp:40
virtual ~AbstractSystem()=default
Defaulted virtual destructor.
virtual void update(double time)=0
Updates the system.
virtual SystemOrder getOrder() const noexcept
virtual void detached(EntityManager &entityManager, SystemManager &systemManager)
A method called by the system manager once the system has been detached from the manager.
virtual void attached(EntityManager &entityManager, SystemManager &systemManager)
A method called by the system manager once the system has been attached to the manager.
Definition ActionHandler.hpp:23
void add(EntityActionHandler< A > &actionHandler)
Adds a new action handler.
Definition ActionManager.hpp:79
void remove(EntityActionHandler< A > &actionHandler)
Removes an existing action handler.
Definition ActionManager.hpp:90
Definition EventManager.hpp:24
The base entity class.
Definition Entity.hpp:41
Definition EntityManager.hpp:49
void addListener(AbstractComponentListener &componentListener)
Add a new ComponentListener to the entity manager.
EntityActionManager & actions() noexcept
void removeListener(AbstractComponentListener &componentListener)
Removes an attached ComponentListener from the entity manager.
T InterfaceType
The system interface type.
Definition System.hpp:176
A system is a special kind of service that is managed internally by the SystemManager.
Definition System.hpp:168
The system manager is responsible for keeping track and dispatching updates to all attached systems.
Definition SystemManager.hpp:22
Definition System.hpp:219
Definition System.hpp:222
Definition Application.hpp:19
constexpr void checkSystem()
A trait that checks if the type S is a valid system type.
Definition System.hpp:216
constexpr bool isSystem
A trait that checks if the type S is a system.
Definition System.hpp:201
unsigned int SystemID
A numeric type that represents a system.
Definition Forward.hpp:78
int SystemOrder
A signed numeric type that represents the order in which a system should be updated by the SystemMana...
Definition System.hpp:31
typename std::enable_if< isSystem< S >, T >::type ifSystem
If the type S is a system (as defined by isSystem<S>), this type is aliased to T.
Definition System.hpp:212
std::bitset< 128 > ComponentMask
A bitset that represents a components mask (i.e. a set of components)
Definition Component.hpp:35
constexpr size_t hash(const T &v)
Generates a hash for the provided type.
Definition Hash.hpp:25
constexpr bool areSystems
A trait that checks if the types Ss are all systems.
Definition System.hpp:205
The ComponentListener is a EntityManager listener type that gets notified whenever an entity matching...
Definition Component.hpp:436
Definition Component.hpp:346
static ComponentMask getComponentMask() noexcept
A trait that contains the minimum component mask for that includes all components in the set.
Definition Component.hpp:357
Definition Entity.hpp:452
Definition Entity.hpp:756
A special type of ComponentListener that listens when an entity becomes a given EntityObject type giv...
Definition System.hpp:105
void componentsAdded(const Entity &entity) noexcept final
A notification dispatched by the SystemManager to a system.
Definition System.hpp:128
virtual void didAdd(const EO &entity) noexcept=0
A notification dispatched by the SystemManager to a system.
void entityDirtied(const Entity &entity, const EntityChangeSet &changeSet) noexcept final
A notification dispatched by the SystemManager to a system.
Definition System.hpp:134
void componentsRemoved(const Entity &entity) noexcept final
A notification dispatched by the SystemManager to a system.
Definition System.hpp:131
virtual void didChange(const EO &entity, const EntityChangeSet &changeSet) noexcept
A notification dispatched by the SystemManager to a system.
Definition System.hpp:124
virtual void didRemove(const EO &entity) noexcept=0
A notification dispatched by the SystemManager to a system.