|
Bomberman
|
Represent a single scene that contains entities. More...
#include <Scene.hpp>
Public Member Functions | |
| int | getID () const |
| Get the ID of this scene. More... | |
| std::list< Entity > & | getEntities () |
| Get the list of entities. More... | |
| Entity & | addEntity (const std::string &name) |
| Add a new entity to the scene. More... | |
| Entity & | scheduleNewEntity (const std::string &name) |
| Add a new entity to the scene, this entity will be added on the next call to applyChanges. More... | |
| template<typename ... Components> | |
| View< Components... > & | view () |
| void | applyChanges () |
| Delete entities marked as deleted and create scheduled entities. More... | |
| Scene ()=default | |
| A default constructor. More... | |
| Scene (const Scene &)=delete | |
| A scene is not copy constructable. More... | |
| ~Scene ()=default | |
| A default destructor. More... | |
| Scene & | operator= (const Scene &) |
| A scene is assignable. More... | |
Public Attributes | |
| friend | Entity |
Private Member Functions | |
| void | _componentAdded (Entity &entity, const std::type_index &type) |
| Notify this scene that a component has been added to the given entity. More... | |
| void | _componentRemoved (const Entity &entity, const std::type_index &type) |
| Notify this scene that a component has been removed to the given entity. More... | |
| void | _entityRemoved (const Entity &entity) |
| Remove an entity from every views. More... | |
Private Attributes | |
| int | _id = _nextID++ |
| An ID representing this scene. More... | |
| std::list< Entity > | _entities = {} |
| The list of registered entities. More... | |
| std::list< Entity > | _newEntities = {} |
| The list of entities to add on the next call to applyChanges. More... | |
| std::vector< std::shared_ptr< IView > > | _views = {} |
| The list of cached views to update. More... | |
Static Private Attributes | |
| static int | _nextID = 0 |
Represent a single scene that contains entities.
|
default |
A default constructor.
|
delete |
A scene is not copy constructable.
|
default |
A default destructor.
|
private |
Notify this scene that a component has been added to the given entity.
| entity | The entity with the new component |
| type | The type of the component added. |
|
private |
Notify this scene that a component has been removed to the given entity.
| entity | The entity with the removed component |
| type | The type of the component removed. |
|
private |
Remove an entity from every views.
| entity | The entity to remove. |
| Entity & WAL::Scene::addEntity | ( | const std::string & | name | ) |
Add a new entity to the scene.
| name | The name of the created entity. |
| void WAL::Scene::applyChanges | ( | ) |
Delete entities marked as deleted and create scheduled entities.
| std::list< Entity > & WAL::Scene::getEntities | ( | ) |
Get the list of entities.
| int WAL::Scene::getID | ( | ) | const |
Get the ID of this scene.
| Entity & WAL::Scene::scheduleNewEntity | ( | const std::string & | name | ) |
Add a new entity to the scene, this entity will be added on the next call to applyChanges.
| name | The name of the created entity. |
|
inline |
|
private |
The list of registered entities.
|
private |
An ID representing this scene.
|
private |
The list of entities to add on the next call to applyChanges.
|
staticprivate |
|
private |
The list of cached views to update.
| friend WAL::Scene::Entity |
1.8.17