aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/api/GameObject.h
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2024-11-13 11:39:45 +0100
committerLoek Le Blansch <loek@pipeframe.xyz>2024-11-13 11:39:45 +0100
commit455bb50a5007daf46b8719fff2a6292da6a294bf (patch)
treedbba8b1f9653a52bb7105f39323a11d85662c0fe /src/crepe/api/GameObject.h
parent3e94ecb3dac5003a3d58210ed1a4d1f1cb2083d1 (diff)
fix physics test
Diffstat (limited to 'src/crepe/api/GameObject.h')
-rw-r--r--src/crepe/api/GameObject.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/crepe/api/GameObject.h b/src/crepe/api/GameObject.h
index d09938a..7751fd0 100644
--- a/src/crepe/api/GameObject.h
+++ b/src/crepe/api/GameObject.h
@@ -8,6 +8,7 @@
namespace crepe {
class ComponentManager;
+class BehaviorScript;
/**
* \brief Represents a GameObject
@@ -67,6 +68,18 @@ protected:
ComponentManager & component_manager;
};
+/**
+ * \brief Add a BehaviorScript component to this game object
+ *
+ * The \c BehaviorScript class is the only exception to the ECS harmony, and
+ * requires a reference to the component manager passed to its constructor in
+ * order to function normally. This is because the \c BehaviorScript (and \c
+ * Script) classes are the only component-related classes that store
+ * implemented member functions as data.
+ */
+template <>
+BehaviorScript & GameObject::add_component<BehaviorScript>();
+
} // namespace crepe
#include "GameObject.hpp"