3 #include "engine/component.h"
4 #include "engine/typedefs.h"
55 const std::unordered_map<EntityId, std::unique_ptr<Component>>&
152 std::unique_ptr<Component> component
172 struct Implementation;
173 std::unique_ptr<Implementation> m_impl;
unsigned int registerChangeCallbacks(ChangeCallback onComponentAdded, ChangeCallback onComponentRemoved)
Registers callbacks for when components are added or removed.
Definition: component_collection.cpp:121
Base class for components.
Definition: component.h:31
Manages entities and their components.
Definition: entity_manager.h:23
void clear()
Empties the component collection.
Definition: component_collection.cpp:80
void unregisterChangeCallbacks(unsigned int id)
Unregisters change callbacks.
Definition: component_collection.cpp:158
Component * operator[](EntityId entityId) const
Definition: component_collection.cpp:45
Definition: bullet_ogre_conversion.h:6
bool empty() const
Checks whether this collection is empty.
Definition: component_collection.cpp:101
std::function< void(EntityId, Component &)> ChangeCallback
Callback for when a component has been added or removed.
Definition: component_collection.h:30
~ComponentCollection()
Destructor.
Definition: component_collection.cpp:41
ComponentTypeId type() const
The type id of the collection's components.
Definition: component_collection.cpp:152
const std::unordered_map< EntityId, std::unique_ptr< Component > > & components() const
Returns a reference to the internal component map.
Definition: component_collection.cpp:95
Utility class for the EntityManager.
Definition: component_collection.h:23