aboutsummaryrefslogtreecommitdiffstats
path: root/yage/engine/engine.h
diff options
context:
space:
mode:
authorYann Herklotz <ymherklotz@gmail.com>2018-01-08 14:09:43 +0000
committerYann Herklotz <ymherklotz@gmail.com>2018-01-08 14:09:43 +0000
commitc514e44b73b3fc4db492e4bd333fa223c6c1eef5 (patch)
treebb1cc421392f263531b82ad1a67454eb351bbd74 /yage/engine/engine.h
parent0a42123b150e06f28ae82e460e854984c2dc9648 (diff)
downloadYAGE-c514e44b73b3fc4db492e4bd333fa223c6c1eef5.tar.gz
YAGE-c514e44b73b3fc4db492e4bd333fa223c6c1eef5.zip
[Engine] Adding entity/component system
Diffstat (limited to 'yage/engine/engine.h')
-rw-r--r--yage/engine/engine.h44
1 files changed, 44 insertions, 0 deletions
diff --git a/yage/engine/engine.h b/yage/engine/engine.h
new file mode 100644
index 00000000..dabe5596
--- /dev/null
+++ b/yage/engine/engine.h
@@ -0,0 +1,44 @@
+/** ---------------------------------------------------------------------------
+ * @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 "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:
+ /// 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_;
+};
+
+} // namespace yage
+
+#endif