diff options
author | Yann Herklotz <ymherklotz@gmail.com> | 2018-04-30 23:00:50 +0100 |
---|---|---|
committer | Yann Herklotz <ymherklotz@gmail.com> | 2018-04-30 23:00:50 +0100 |
commit | f338b4d15b57770d922e187b7a57d25fbf379b62 (patch) | |
tree | 68a9b14e9dd0dcec798bbce473f5cc8971d3be96 /yage/entity/space.h | |
parent | 8745306ddc2db08d52caf1c3c456c0bc43a062b7 (diff) | |
download | YAGE-f338b4d15b57770d922e187b7a57d25fbf379b62.tar.gz YAGE-f338b4d15b57770d922e187b7a57d25fbf379b62.zip |
Adding support for entity component systems.
Diffstat (limited to 'yage/entity/space.h')
-rw-r--r-- | yage/entity/space.h | 34 |
1 files changed, 20 insertions, 14 deletions
diff --git a/yage/entity/space.h b/yage/entity/space.h index 96154ffc..2bee7da5 100644 --- a/yage/entity/space.h +++ b/yage/entity/space.h @@ -10,18 +10,22 @@ #define YAGE_ENGINE_SPACE_H #include <vector> +#include <memory> #include "entitymanager.h" namespace yage { +class System; + /** - * Space that keeps track of all the entities, componenets and runs the systems - * on the data to update them. There can be multiple instances of a space, which - * can be used, for example, for different levels in the game that can be loaded - * separately, or a game menu that can be loaded above the other spaces when the - * user presses on pause. + * Space that keeps track of all the entities, componenets and runs + * the systems on the data to update them. There can be multiple + * instances of a space, which can be used, for example, for different + * levels in the game that can be loaded separately, or a game menu + * that can be loaded above the other spaces when the user presses on + * pause. */ class Space { @@ -32,23 +36,25 @@ public: Space(); /** - * Create an entity that will belong to this space, and return the handle to - * the user. The Entity class itself should not be visible to the user, as - * the user only needs to worry about the handle when referring to the - * Entity and changing it. + * Create an entity that will belong to this space, and return the + * handle to the user. The Entity class itself should not be + * visible to the user, as the user only needs to worry about the + * handle when referring to the Entity and changing it. */ unsigned createEntity(); private: /** - * The subspaces of the Space that act on the data and on their respective - * component. These are specific to the Space, as other spaces might have - * different Systems and not act on the same entities. + * The systems of the Space that act on the data and on their + * respective component. These are specific to the Space, as other + * spaces might have different Systems and not act on the same + * entities. */ + std::vector<std::unique_ptr<System>> systems_; /** - * Manages all the entities in the system, can create them for the current - * space. + * Manages all the entities in the system, can create them for the + * current space. */ EntityManager em_; }; |