aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/api/BehaviorScript.h
diff options
context:
space:
mode:
authorheavydemon21 <nielsstunnebrink1@gmail.com>2024-10-22 12:15:49 +0200
committerheavydemon21 <nielsstunnebrink1@gmail.com>2024-10-22 12:15:49 +0200
commit6b213f304b35be5c11bbea305698d6e365a7ffca (patch)
tree4526831be8e6a09a9e1608b71294213ce57fddb1 /src/crepe/api/BehaviorScript.h
parent9037aca03bfa4312794a6954752628381256f777 (diff)
parent30d84ef9ad4a0010288db18294766fd4d5ed6f4a (diff)
Merge branch 'master' into niels/rendering
Diffstat (limited to 'src/crepe/api/BehaviorScript.h')
-rw-r--r--src/crepe/api/BehaviorScript.h30
1 files changed, 25 insertions, 5 deletions
diff --git a/src/crepe/api/BehaviorScript.h b/src/crepe/api/BehaviorScript.h
index 1d05a75..6ce6798 100644
--- a/src/crepe/api/BehaviorScript.h
+++ b/src/crepe/api/BehaviorScript.h
@@ -1,16 +1,36 @@
#pragma once
-#include "../Component.h"
-#include "../Script.h"
+#include <memory>
+
+#include "Component.h"
+#include "Script.h"
+
+namespace crepe {
+class ScriptSystem;
+class ComponentManager;
+} // namespace crepe
namespace crepe::api {
-class BehaviorScript : public Script, public Component {
- // only allow ComponentManager to instantiate scripts
- friend class ComponentManager;
+class Script;
+class BehaviorScript : public Component {
protected:
+ friend class crepe::ComponentManager;
BehaviorScript();
+
+public:
+ virtual ~BehaviorScript() = default;
+
+public:
+ template <class T>
+ BehaviorScript & set_script();
+
+protected:
+ friend class crepe::ScriptSystem;
+ std::unique_ptr<Script> script = nullptr;
};
} // namespace crepe::api
+
+#include "BehaviorScript.hpp"