diff options
author | Loek Le Blansch <loek@pipeframe.xyz> | 2024-10-17 17:15:53 +0200 |
---|---|---|
committer | Loek Le Blansch <loek@pipeframe.xyz> | 2024-10-17 17:15:53 +0200 |
commit | a2c719948ff8af9abe267c4d1c9b16cd1e2fb317 (patch) | |
tree | b2509bc9d435e7efc0afdf99f82a8b483f65758f /src/crepe/api | |
parent | 9fd3bdca9de2d37b63e1646b22d32b0b182f01ee (diff) |
`make format`
Diffstat (limited to 'src/crepe/api')
-rw-r--r-- | src/crepe/api/BehaviorScript.cpp | 7 | ||||
-rw-r--r-- | src/crepe/api/BehaviorScript.h | 8 | ||||
-rw-r--r-- | src/crepe/api/BehaviorScript.hpp | 4 | ||||
-rw-r--r-- | src/crepe/api/Script.cpp | 2 | ||||
-rw-r--r-- | src/crepe/api/Script.h | 4 |
5 files changed, 10 insertions, 15 deletions
diff --git a/src/crepe/api/BehaviorScript.cpp b/src/crepe/api/BehaviorScript.cpp index 7a93f10..1f236b4 100644 --- a/src/crepe/api/BehaviorScript.cpp +++ b/src/crepe/api/BehaviorScript.cpp @@ -1,11 +1,8 @@ #include "../util/log.h" -#include "Script.h" #include "BehaviorScript.h" +#include "Script.h" using namespace crepe::api; -BehaviorScript::BehaviorScript() { - dbg_trace(); -} - +BehaviorScript::BehaviorScript() { dbg_trace(); } diff --git a/src/crepe/api/BehaviorScript.h b/src/crepe/api/BehaviorScript.h index 756c2ca..b8263ca 100644 --- a/src/crepe/api/BehaviorScript.h +++ b/src/crepe/api/BehaviorScript.h @@ -7,7 +7,7 @@ namespace crepe { class ScriptSystem; class ComponentManager; -} +} // namespace crepe namespace crepe::api { @@ -17,11 +17,12 @@ class BehaviorScript : public Component { protected: friend class crepe::ComponentManager; BehaviorScript(); + public: virtual ~BehaviorScript() = default; public: - template<class T> + template <class T> BehaviorScript & set_script(); protected: @@ -29,7 +30,6 @@ protected: std::unique_ptr<Script> script = nullptr; }; -} +} // namespace crepe::api #include "BehaviorScript.hpp" - diff --git a/src/crepe/api/BehaviorScript.hpp b/src/crepe/api/BehaviorScript.hpp index 9a1f427..a6bd81c 100644 --- a/src/crepe/api/BehaviorScript.hpp +++ b/src/crepe/api/BehaviorScript.hpp @@ -7,7 +7,7 @@ namespace crepe::api { -template<class T> +template <class T> BehaviorScript & BehaviorScript::set_script() { static_assert(std::is_base_of<Script, T>::value); dbg_trace(); @@ -16,4 +16,4 @@ BehaviorScript & BehaviorScript::set_script() { return *this; } -} +} // namespace crepe::api diff --git a/src/crepe/api/Script.cpp b/src/crepe/api/Script.cpp index 6259574..5016ed0 100644 --- a/src/crepe/api/Script.cpp +++ b/src/crepe/api/Script.cpp @@ -1,5 +1,3 @@ #include "Script.h" using namespace crepe::api; - - diff --git a/src/crepe/api/Script.h b/src/crepe/api/Script.h index b1e6a95..0036d1f 100644 --- a/src/crepe/api/Script.h +++ b/src/crepe/api/Script.h @@ -8,6 +8,7 @@ namespace crepe::api { class Script { friend class crepe::ScriptSystem; + protected: virtual void init() {} virtual void update() {} @@ -17,5 +18,4 @@ protected: // added event. }; -} - +} // namespace crepe::api |