aboutsummaryrefslogtreecommitdiff
path: root/mwe/ecs-homemade/inc/GameObjectMax.hpp
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2024-10-10 07:04:27 +0200
committerLoek Le Blansch <loek@pipeframe.xyz>2024-10-10 07:04:27 +0200
commit29fb4bda4872bdfe33a2416a239fb62fc0238167 (patch)
tree367f8b32fc843b481b42dff54adfd0939afeb0b7 /mwe/ecs-homemade/inc/GameObjectMax.hpp
parent08d0b07c19edfe8c81dfe4e21c0d4c1ef128b628 (diff)
parentdcfb674ccdf48a7fd78c98644e5b3b826c399206 (diff)
merge `loek/scripts` into `master`
Diffstat (limited to 'mwe/ecs-homemade/inc/GameObjectMax.hpp')
-rw-r--r--mwe/ecs-homemade/inc/GameObjectMax.hpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/mwe/ecs-homemade/inc/GameObjectMax.hpp b/mwe/ecs-homemade/inc/GameObjectMax.hpp
new file mode 100644
index 0000000..91d51ea
--- /dev/null
+++ b/mwe/ecs-homemade/inc/GameObjectMax.hpp
@@ -0,0 +1,7 @@
+#include "ComponentManager.h"
+
+template <typename T, typename... Args>
+void GameObject::AddComponent(Args &&... args) {
+ ComponentManager::GetInstance().AddComponent<T>(
+ mId, std::forward<Args>(args)...);
+}