aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYann Herklotz <ymherklotz@gmail.com>2018-04-29 22:56:18 +0100
committerYann Herklotz <ymherklotz@gmail.com>2018-04-29 22:56:18 +0100
commitc44456496fe13800e36b8bf257eb2bd5d94faa30 (patch)
treecadd16dd5b6b51dfa5f2365000922da35668ff72
parent8745306ddc2db08d52caf1c3c456c0bc43a062b7 (diff)
downloadYAGE-c44456496fe13800e36b8bf257eb2bd5d94faa30.tar.gz
YAGE-c44456496fe13800e36b8bf257eb2bd5d94faa30.zip
Working on the entity system
-rw-r--r--yage/entity/engine.h2
-rw-r--r--yage/entity/space.h5
-rw-r--r--yage/entity/system.h20
3 files changed, 7 insertions, 20 deletions
diff --git a/yage/entity/engine.h b/yage/entity/engine.h
index 6e1bf49a..146ee6d5 100644
--- a/yage/entity/engine.h
+++ b/yage/entity/engine.h
@@ -31,6 +31,8 @@ public:
/// Updates the systems.
void update();
+ void registerSystem();
+
/// Returns the instance of the engine, as there is only one instance of the
/// engine.
static Engine &instance();
diff --git a/yage/entity/space.h b/yage/entity/space.h
index 96154ffc..7f73dbbe 100644
--- a/yage/entity/space.h
+++ b/yage/entity/space.h
@@ -10,8 +10,10 @@
#define YAGE_ENGINE_SPACE_H
#include <vector>
+#include <memory>
#include "entitymanager.h"
+#include "system.h"
namespace yage
{
@@ -41,10 +43,11 @@ public:
private:
/**
- * The subspaces of the Space that act on the data and on their respective
+ * 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
diff --git a/yage/entity/system.h b/yage/entity/system.h
index 47d176c9..15845390 100644
--- a/yage/entity/system.h
+++ b/yage/entity/system.h
@@ -16,27 +16,9 @@
namespace yage
{
-class BaseSystem : public yage::NonCopyable
+class System : public NonCopyable
{
public:
- typedef std::size_t Identifier;
-
- virtual void update() = 0;
-
-protected:
- Identifier id_;
-};
-
-/**
- * System interface for the different systems in the engine.
- */
-template <typename Derived>
-class System : public BaseSystem
-{
-public:
-};
-
-class SystemManager : public yage::NonCopyable {
};