diff options
author | Loek Le Blansch <loek@pipeframe.xyz> | 2024-12-18 14:20:59 +0100 |
---|---|---|
committer | Loek Le Blansch <loek@pipeframe.xyz> | 2024-12-18 14:20:59 +0100 |
commit | cff284cedde9f0cc133ff2855557299ce1d8083c (patch) | |
tree | 7aafa1892cca039b5e59db8a748d91a8857262da /src/crepe/system/ScriptSystem.h | |
parent | 8dfdb5a588614db80fa8f41ccf883c1766fe56ff (diff) |
add fixed/frame update functions to script
Diffstat (limited to 'src/crepe/system/ScriptSystem.h')
-rw-r--r-- | src/crepe/system/ScriptSystem.h | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/crepe/system/ScriptSystem.h b/src/crepe/system/ScriptSystem.h index 612c2ae..ca4534a 100644 --- a/src/crepe/system/ScriptSystem.h +++ b/src/crepe/system/ScriptSystem.h @@ -2,6 +2,8 @@ #include "System.h" +#include "../manager/LoopTimerManager.h" + namespace crepe { class Script; @@ -16,13 +18,25 @@ class ScriptSystem : public System { public: using System::System; /** - * \brief Call Script::update() on all active \c BehaviorScript instances + * \brief Call Script::fixed_update() on all active \c BehaviorScript instances * * This routine updates all scripts sequentially using the Script::update() * method. It also calls Script::init() if this has not been done before on * the \c BehaviorScript instance. */ void fixed_update() override; + + /** + * \brief Call Script::frame_update() on all active \c BehaviorScript instances + * + * This routine updates all scripts sequentially using the Script::update() + * method. It also calls Script::init() if this has not been done before on + * the \c BehaviorScript instance. + */ + void frame_update() override; + +private: + void update(void (Script::* update_function)(duration_t), const duration_t & delta_time); }; } // namespace crepe |