aboutsummaryrefslogtreecommitdiffstats
path: root/yage/entity/engine.h
diff options
context:
space:
mode:
authorYann Herklotz <ymherklotz@gmail.com>2018-04-30 23:00:50 +0100
committerYann Herklotz <ymherklotz@gmail.com>2018-04-30 23:00:50 +0100
commitf338b4d15b57770d922e187b7a57d25fbf379b62 (patch)
tree68a9b14e9dd0dcec798bbce473f5cc8971d3be96 /yage/entity/engine.h
parent8745306ddc2db08d52caf1c3c456c0bc43a062b7 (diff)
downloadYAGE-f338b4d15b57770d922e187b7a57d25fbf379b62.tar.gz
YAGE-f338b4d15b57770d922e187b7a57d25fbf379b62.zip
Adding support for entity component systems.
Diffstat (limited to 'yage/entity/engine.h')
-rw-r--r--yage/entity/engine.h17
1 files changed, 14 insertions, 3 deletions
diff --git a/yage/entity/engine.h b/yage/entity/engine.h
index 6e1bf49a..fe7e5eb0 100644
--- a/yage/entity/engine.h
+++ b/yage/entity/engine.h
@@ -9,16 +9,21 @@
#ifndef YAGE_CORE_ENGINE_H
#define YAGE_CORE_ENGINE_H
-#include "../core/window.h"
#include "system.h"
+#include "../core/window.h"
+#include <memory>
#include <vector>
namespace yage
{
-/// Main engine class that contains a systems, the main loop and the update
-/// function that updates all the systems.
+class Space;
+
+/**
+ * Main engine class that contains a systems, the main loop and the update
+ * function that updates all the systems.
+ */
class Engine
{
public:
@@ -31,6 +36,9 @@ public:
/// Updates the systems.
void update();
+ /// Add spaces to the engine
+ void addSpace(std::unique_ptr<Space> space);
+
/// Returns the instance of the engine, as there is only one instance of the
/// engine.
static Engine &instance();
@@ -38,6 +46,9 @@ public:
private:
/// Window
Window window_;
+
+ /// A vector of all the spaces
+ std::vector<std::unique_ptr<Space>> spaces_;
};
} // namespace yage