|
Acheron
|
Container for components. More...
#include <component_array.hpp>
Public Member Functions | |
| void | InsertData (Entity entity, T component) |
| Add a component and its data to an entity. | |
| bool | HasData (Entity entity) const |
| Checks if en entity has a component. | |
| void | RemoveData (Entity entity) |
| Removes a component and its data associated with an entity. | |
| T & | GetData (Entity entity) |
| Gets component data from an entity. | |
| void | EntityDespawned (Entity entity) override |
| Called when an entity is despawned to remove all its component data. | |
Container for components.
This class handles the association with entities and components, and holds the data for components
| T | The component type |
|
inlineoverridevirtual |
Called when an entity is despawned to remove all its component data.
| entity | Entity that was despawned |
Reimplemented from acheron::ecs::IComponentArray.
|
inline |
Gets component data from an entity.
| entity | Entity to retrieve the data from |
|
inline |
Checks if en entity has a component.
| entity | The entity to check |
|
inline |
Add a component and its data to an entity.
| entity | The entity to apply the component to |
| component | The component to apply to the entity |
| Assert | Fail if the entity already has component T on it |
|
inline |
Removes a component and its data associated with an entity.
| entity | The entity to remove the component from |
| Assert | Fail if the component doesnt exist on the entity |