13#include <unordered_set>
48 virtual void run() = 0;
124 static size_t nextID;
127inline size_t System::nextID = 0;
std::vector< std::string > rejectedComponents
Represent the components this System absolutely doesn't want.
Definition System.h:66
const size_t & getID()
Return the System's ID.
virtual void run()=0
This is an abstract method which will contains the logic of the System and can be call by the user to...
bool getChange()
Return the value of change and, if change is true flipped it back to false.
std::unordered_set< int > entities
The entities of this system.
Definition System.h:54
void newEntity(int entity)
UPDATE THAT.
System(std::shared_ptr< Environment > environment, bool autoUpdate=true)
The constructor of the System, which take the Environment as a parameter.
std::vector< std::string > desiredTags
Represent the tags this System want.
Definition System.h:70
std::shared_ptr< Environment > environment
A shared_ptr towards the Environment.
Definition System.h:58
void addComponent(const std::string &name)
Let you add, inside a System, which component should be gathered from the Environment.
void changeEnvironment(std::shared_ptr< Environment > environment)
Let you change the Environment.
void addTag(const std::string &tagName)
Let you add, inside a System, which tag should be gathered from the Environment.
void addRejects(std::vector< std::string > names)
Version with a list of rejected components.
void addComponents(std::vector< std::string > names)
Version with a list of desired components.
void addTags(std::vector< std::string > names)
Version with a list of tags.
void addRejected(const std::string &name)
Let you add a components to the rejected components, if the entity possess at list one of this compon...
std::vector< std::string > desiredComponents
Represent the components this System want.
Definition System.h:62
std::mutex mtx
Mutex for the entities' vector.
Definition System.h:74