libes
0.5.3
an Entity System library for C++
|
A store. More...
#include <es/Store.h>
Public Member Functions | |
bool | has (Entity e) |
Tell whether an entity is present in this store. More... | |
Component * | get (Entity e) |
Get the compnent associated to an entity. More... | |
bool | add (Entity e, Component *c) |
Add a component to an entity. More... | |
bool | remove (Entity e) |
Remove a component from an entity. More... | |
std::set< Entity > | getEntities () const |
Get all the entities that have a component of this type. More... | |
Friends | |
template<typename C > | |
class | ComponentStore |
A store.
A store is tied to a component type. It handles the association between an entity and its component of this type.
Add a component to an entity.
The user is responsible to allocate the component.
e | the entity |
c | the component |
Get the compnent associated to an entity.
e | the entity |
std::set<Entity> es::Store::getEntities | ( | ) | const |
Get all the entities that have a component of this type.
bool es::Store::has | ( | Entity | e | ) |
Tell whether an entity is present in this store.
e | the entity |
bool es::Store::remove | ( | Entity | e | ) |
Remove a component from an entity.
The user is responsible for deleting the component.
e | the entity |
|
friend |