|
Simple C++ Game
|
An implementation of EntitySystem that iterates through all Entity objects in EntitySystem::getEntities() each EntitySystem::update. More...
#include <IteratingSystem.hpp>


Public Member Functions | |
| IteratingSystem () | |
| Construct a new IteratingSystem with the default EntitySystem constructor. More... | |
| IteratingSystem (const std::shared_ptr< EntityFamily > &family) | |
| Construct a new IteratingSystem with the EntityFamily EntitySystem constructor. More... | |
| void | update (const sf::Time deltaTime) |
| Iterates through each element in the system to perform updates. More... | |
Public Member Functions inherited from EntitySystem | |
| EntitySystem () | |
| Construct a new default EntitySystem. More... | |
| EntitySystem (const std::shared_ptr< EntityFamily > &family) | |
| Construct a new EntitySystem that acts on a specified family. More... | |
| virtual void | engineEntityAdded (const std::shared_ptr< Entity > &entity) |
| Performs any operations required after an entity has been added to an EntityEngine the system is a part of. More... | |
Protected Member Functions | |
| virtual void | process (std::shared_ptr< Entity > &entity, sf::Time deltaTime)=0 |
| Processes a specific entity. More... | |
Protected Member Functions inherited from EntitySystem | |
| virtual std::map< int, std::shared_ptr< Entity > > | getEntities () const |
| Get the Entities in the system. More... | |
An implementation of EntitySystem that iterates through all Entity objects in EntitySystem::getEntities() each EntitySystem::update.
| IteratingSystem::IteratingSystem | ( | ) |
Construct a new IteratingSystem with the default EntitySystem constructor.
| IteratingSystem::IteratingSystem | ( | const std::shared_ptr< EntityFamily > & | family | ) |
Construct a new IteratingSystem with the EntityFamily EntitySystem constructor.
| family | The family to provide to the EntitySystem constructor |
|
protectedpure virtual |
Processes a specific entity.
This method is pure virtual in IteratingSystem. It is up to sublcasses to implement their specific needs.
| entity | The current entity being processed. |
| deltaTime | The amount of time that has passed since process() was last called for this entity. |
Implemented in VelocitySystem, RenderSystem, PlayerInputSystem, BallSystem, and EnemyAISystem.
|
virtual |
Iterates through each element in the system to perform updates.
For each element in EntitySystem::getEntities(), calls IteratingSystem::process.
| deltaTime | The amount of time that has passed since this method was last called |
Implements EntitySystem.