diff options
Diffstat (limited to 'source/gameengine/GameLogic/SCA_IActuator.h')
-rw-r--r-- | source/gameengine/GameLogic/SCA_IActuator.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/source/gameengine/GameLogic/SCA_IActuator.h b/source/gameengine/GameLogic/SCA_IActuator.h index bff32dcebaa..7ffb21b5490 100644 --- a/source/gameengine/GameLogic/SCA_IActuator.h +++ b/source/gameengine/GameLogic/SCA_IActuator.h @@ -34,8 +34,11 @@ class SCA_IActuator : public SCA_ILogicBrick { + friend class SCA_LogicManager; protected: std::vector<CValue*> m_events; + int m_links; // number of active links to controllers + // when 0, the actuator is automatically stopped void RemoveAllEvents(); public: @@ -47,6 +50,15 @@ public: PyTypeObject* T =&Type); /** + * UnlinkObject(...) + * Certain actuator use gameobject pointers (like TractTo actuator) + * This function can be called when an object is removed to make + * sure that the actuator will not use it anymore. + */ + + virtual bool UnlinkObject(SCA_IObject* clientobj) { return false; } + + /** * Update(...) * Update the actuator based upon the events received since * the last call to Update, the current time and deltatime the @@ -74,6 +86,11 @@ public: */ bool IsNegativeEvent() const; virtual ~SCA_IActuator(); + + void ClrLink() { m_links=0; } + void IncLink() { m_links++; } + void DecLink(); + bool IsNoLink() const { return !m_links; } }; #endif //__KX_IACTUATOR |