diff options
Diffstat (limited to 'src/crepe/api')
-rw-r--r-- | src/crepe/api/Script.cpp | 3 | ||||
-rw-r--r-- | src/crepe/api/Script.h | 13 |
2 files changed, 15 insertions, 1 deletions
diff --git a/src/crepe/api/Script.cpp b/src/crepe/api/Script.cpp index 34e7908..cafc636 100644 --- a/src/crepe/api/Script.cpp +++ b/src/crepe/api/Script.cpp @@ -45,3 +45,6 @@ void Script::replay::release(recording_t recording) { ReplayManager & mgr = this->mediator->replay_manager; return mgr.release(recording); } + +LoopTimerManager & Script::get_loop_timer() const { return this->mediator->loop_timer; } + diff --git a/src/crepe/api/Script.h b/src/crepe/api/Script.h index 6536fa4..b052f8b 100644 --- a/src/crepe/api/Script.h +++ b/src/crepe/api/Script.h @@ -3,6 +3,7 @@ #include <vector> #include "../manager/EventManager.h" +#include "../manager/LoopTimerManager.h" #include "../manager/Mediator.h" #include "../manager/ReplayManager.h" #include "../system/CollisionSystem.h" @@ -48,9 +49,17 @@ protected: /** * \brief Script update function (empty by default) * + * \param delta_time Time since last fixed update + * * This function is called during the ScriptSystem::update() routine if the \c BehaviorScript * component holding this script instance is active. */ + virtual void update(duration_t delta_time) { return this->update(); } + /** + * \brief Fallback script update function (empty by default) + * + * Allows the game programmer to ignore parameters passed to \c update() + */ virtual void update() {} //! \} @@ -157,7 +166,9 @@ protected: replay(OptionalRef<Mediator> & mediator) : mediator(mediator) {} friend class Script; } replay{mediator}; - //! \} + + //! Retrieve LoopTimerManager reference + LoopTimerManager & get_loop_timer() const; private: /** |