diff options
author | Loek Le Blansch <loek@pipeframe.xyz> | 2024-10-21 10:42:10 +0200 |
---|---|---|
committer | Loek Le Blansch <loek@pipeframe.xyz> | 2024-10-21 10:42:10 +0200 |
commit | 157cdabe941be14ca72022e7a7c8c55a582a7c1c (patch) | |
tree | ca09caaa0b4a8ec8ba7c6a109445be4339f08cb1 /src/crepe/api/BehaviorScript.h | |
parent | 58dfdba241b501d4b1b9688b44ee775507ec325b (diff) | |
parent | 0fdebc7d7a143ad2b9b5ed6a596bf4bb1f0f7d7f (diff) |
merge loek/scripts into loek/config
Diffstat (limited to 'src/crepe/api/BehaviorScript.h')
-rw-r--r-- | src/crepe/api/BehaviorScript.h | 30 |
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" |