aboutsummaryrefslogtreecommitdiffstats
path: root/yage/entity/engine.h
diff options
context:
space:
mode:
authorYann Herklotz <ymherklotz@gmail.com>2018-02-13 19:14:33 +0000
committerYann Herklotz <ymherklotz@gmail.com>2018-02-13 19:14:33 +0000
commit49af8b16ae3f9e6579656ed10f815e9c465557d0 (patch)
tree1dff4aea6a59c466ea6a6f15ad7f5e2ac69f5b37 /yage/entity/engine.h
parente9bd903761605c7619a235edddf07c3a0b963968 (diff)
downloadYAGE-49af8b16ae3f9e6579656ed10f815e9c465557d0.tar.gz
YAGE-49af8b16ae3f9e6579656ed10f815e9c465557d0.zip
[entity] Starting work on entity system.
Diffstat (limited to 'yage/entity/engine.h')
-rw-r--r--yage/entity/engine.h51
1 files changed, 51 insertions, 0 deletions
diff --git a/yage/entity/engine.h b/yage/entity/engine.h
new file mode 100644
index 00000000..147769e5
--- /dev/null
+++ b/yage/entity/engine.h
@@ -0,0 +1,51 @@
+/** ---------------------------------------------------------------------------
+ * @file: engine.h
+ *
+ * Copyright (c) 2017 Yann Herklotz Grave <ymherklotz@gmail.com>
+ * MIT License, see LICENSE file for more details.
+ * ----------------------------------------------------------------------------
+ */
+
+#ifndef YAGE_CORE_ENGINE_H
+#define YAGE_CORE_ENGINE_H
+
+#include "../core/window.h"
+#include "system.h"
+
+#include <vector>
+
+namespace yage
+{
+
+/// Main engine class that contains a systems, the main loop and the update
+/// function that updates all the systems.
+class Engine
+{
+public:
+ /// Initialize window and other aspects of the engine.
+ void init();
+
+ /// Main game loop of the engine.
+ void mainLoop();
+
+ /// Updates the systems.
+ void update();
+
+ /// Adds a system to the engine.
+ void addSystem(System *system);
+
+ /// Returns the instance of the engine, as there is only one instance of the
+ /// engine.
+ static Engine &instance();
+
+private:
+ /// Vector of all the systems in the engine.
+ std::vector<System *> systems_;
+
+ /// Window
+ Window window_;
+};
+
+} // namespace yage
+
+#endif