Simple C++ Game
IteratingSystem.hpp
1 #pragma once
2 
3 #include <EntitySystem.hpp>
4 
10 {
11 public:
17 
25  IteratingSystem(const std::shared_ptr<EntityFamily> &family);
26 
35  void update(const sf::Time deltaTime);
36 
37 protected:
46  virtual void process(std::shared_ptr<Entity> &entity, sf::Time deltaTime) = 0;
47 };
A class representing a system that processes groups of Entity in an EntityEngine.
Definition: EntitySystem.hpp:18
An implementation of EntitySystem that iterates through all Entity objects in EntitySystem::getEntiti...
Definition: IteratingSystem.hpp:10
virtual void process(std::shared_ptr< Entity > &entity, sf::Time deltaTime)=0
Processes a specific entity.
void update(const sf::Time deltaTime)
Iterates through each element in the system to perform updates.
IteratingSystem()
Construct a new IteratingSystem with the default EntitySystem constructor.
IteratingSystem(const std::shared_ptr< EntityFamily > &family)
Construct a new IteratingSystem with the EntityFamily EntitySystem constructor.