aboutsummaryrefslogtreecommitdiffstats
path: root/yage/entity/system.h
diff options
context:
space:
mode:
authorYann Herklotz <ymherklotz@gmail.com>2018-02-13 20:03:16 +0000
committerYann Herklotz <ymherklotz@gmail.com>2018-02-13 20:03:16 +0000
commit2ff28e1127a82610d9402c90f7a2d1c1c7a19b6f (patch)
treee8b523f39bc85f6f32d1881b3843d21157d526f2 /yage/entity/system.h
parent49af8b16ae3f9e6579656ed10f815e9c465557d0 (diff)
downloadYAGE-2ff28e1127a82610d9402c90f7a2d1c1c7a19b6f.tar.gz
YAGE-2ff28e1127a82610d9402c90f7a2d1c1c7a19b6f.zip
[entity] Fixing builds too
Diffstat (limited to 'yage/entity/system.h')
-rw-r--r--yage/entity/system.h52
1 files changed, 20 insertions, 32 deletions
diff --git a/yage/entity/system.h b/yage/entity/system.h
index 9100fa17..47d176c9 100644
--- a/yage/entity/system.h
+++ b/yage/entity/system.h
@@ -9,48 +9,36 @@
#ifndef YAGE_ENGINE_SYSTEM_H
#define YAGE_ENGINE_SYSTEM_H
+#include <cstddef>
+
+#include "../util/noncopyable.h"
+
namespace yage
{
+class BaseSystem : public yage::NonCopyable
+{
+public:
+ typedef std::size_t Identifier;
+
+ virtual void update() = 0;
+
+protected:
+ Identifier id_;
+};
+
/**
* System interface for the different systems in the engine.
*/
-class System
+template <typename Derived>
+class System : public BaseSystem
{
public:
- /**
- * Virtual destructor to destroy all the objects that implement this
- * properly.
- */
- virtual ~System() = 0;
-
- /**
- * Initializes the system. Good practice to have this function instead
- * using the constructor.
- */
- virtual void init() = 0;
-
- /**
- * Updates the system at each interval using the time step.
- *
- * @param dt The time difference between the previous frame and the current one.
- */
- virtual void update(double dt) = 0;
-
- /**
- * Destroy the system and the components that are contained in it.
- */
- virtual void destroy() = 0;
};
-/**
- * Implement the default destructor, but leaving it as purely virtual in the
- * definition of the abstract class. This is so that the classes that implement
- * the abstract class have to implement a desctructor, but at the same time,
- * that there is no undefined behavious when the stack unwinds to the system and
- * calls the system destructor.
- */
-inline System::~System() {}
+class SystemManager : public yage::NonCopyable {
+
+};
} // namespace yage