From c44456496fe13800e36b8bf257eb2bd5d94faa30 Mon Sep 17 00:00:00 2001 From: Yann Herklotz Date: Sun, 29 Apr 2018 22:56:18 +0100 Subject: Working on the entity system --- yage/entity/engine.h | 2 ++ yage/entity/space.h | 5 ++++- yage/entity/system.h | 20 +------------------- 3 files changed, 7 insertions(+), 20 deletions(-) (limited to 'yage/entity') 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 +#include #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> 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 -class System : public BaseSystem -{ -public: -}; - -class SystemManager : public yage::NonCopyable { }; -- cgit