aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYann Herklotz <ymherklotz@gmail.com>2018-02-08 20:48:49 +0000
committerYann Herklotz <ymherklotz@gmail.com>2018-02-08 20:48:49 +0000
commite9bd903761605c7619a235edddf07c3a0b963968 (patch)
treeaddc371ab13aa135976ac2c9774192cbb4a3b4b2
parent6c4772685909f1f47aa902532d955c77b8e8271d (diff)
downloadYAGE-e9bd903761605c7619a235edddf07c3a0b963968.tar.gz
YAGE-e9bd903761605c7619a235edddf07c3a0b963968.zip
[Engine] More entity component systems options.
-rw-r--r--examples/CMakeLists.txt1
-rw-r--r--tests/engine/entities.json23
-rw-r--r--tests/engine/test.cpp1
-rw-r--r--yage/engine/system.h5
4 files changed, 29 insertions, 1 deletions
diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt
index 156b6a34..7222d507 100644
--- a/examples/CMakeLists.txt
+++ b/examples/CMakeLists.txt
@@ -8,3 +8,4 @@ endfunction(make_example)
make_example(simplegame)
make_example(shooter)
+make_example(render3d)
diff --git a/tests/engine/entities.json b/tests/engine/entities.json
new file mode 100644
index 00000000..25959311
--- /dev/null
+++ b/tests/engine/entities.json
@@ -0,0 +1,23 @@
+{
+ "Entities": [
+ {
+ "name": "Object1",
+ "mass": "Hello",
+ "position": [
+ 0,
+ 0,
+ 0
+ ],
+ "velocity": [
+ 0,
+ 0,
+ 0
+ ],
+ "acceleration": [
+ 0,
+ 0,
+ 0
+ ]
+ }
+ ]
+}
diff --git a/tests/engine/test.cpp b/tests/engine/test.cpp
index 6026e40a..be8e6782 100644
--- a/tests/engine/test.cpp
+++ b/tests/engine/test.cpp
@@ -8,7 +8,6 @@ int main()
auto entity = space.createEntity();
auto entity2 = space.createEntity();
auto entity3 = space.createEntity();
-
auto entity4 = space.createEntity();
yLogInfo << "Entity 1: " << entity;
diff --git a/yage/engine/system.h b/yage/engine/system.h
index 32d6fc34..9100fa17 100644
--- a/yage/engine/system.h
+++ b/yage/engine/system.h
@@ -36,6 +36,11 @@ public:
* @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;
};
/**