Simple C++ Game
|
A class representing a system that processes groups of Entity in an EntityEngine. More...
#include <EntitySystem.hpp>
Public Member Functions | |
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... | |
virtual void | update (const sf::Time deltaTime)=0 |
Performs any operations necessary in routine processing. More... | |
Protected Member Functions | |
virtual std::map< int, std::shared_ptr< Entity > > | getEntities () const |
Get the Entities in the system. More... | |
A class representing a system that processes groups of Entity in an EntityEngine.
An abstract class to be extended by specific implementations.
EntitySystem::EntitySystem | ( | ) |
Construct a new default EntitySystem.
This creates an EntitySystem that processes all Entities added to the EntityEngine if EntitySystem::engineEngineEntityAdded is not overridden.
EntitySystem::EntitySystem | ( | const std::shared_ptr< EntityFamily > & | family | ) |
Construct a new EntitySystem that acts on a specified family.
family | The family of entities that this system will act on. The EntitySystem implementation of EntitySystem::engineEntityAdded adds all entities to the system for which this family's implementation of EntityFamily::isInFamily returns true. |
|
virtual |
Performs any operations required after an entity has been added to an EntityEngine the system is a part of.
The default implementation adds the Entity to the Entities property (EntitySystem::getEntities) if the default constructor was called or the Entity is in the family provided to the family constructor.
entity | The Entity recently added to the EntityEngine. |
|
protectedvirtual |
Get the Entities in the system.
|
pure virtual |
Performs any operations necessary in routine processing.
This method is pure virtual in EntitySystem.
deltaTime | The time that has passed since update() was last called. |
Implemented in IteratingSystem.