diff options
Diffstat (limited to 'src/scripting/script.hpp')
-rw-r--r-- | src/scripting/script.hpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/scripting/script.hpp b/src/scripting/script.hpp index c87bf182..24a415ef 100644 --- a/src/scripting/script.hpp +++ b/src/scripting/script.hpp @@ -124,11 +124,13 @@ class Script MapComposite *getMap() const { return mMap; } - EventListener *getScriptDeathListener() + EventListener *getScriptListener() { return &mEventListener; } virtual void processDeathEvent(Being* thing) = 0; + virtual void processRemoveEvent(Thing* thing) = 0; + protected: std::string mScriptFile; @@ -136,18 +138,19 @@ class Script MapComposite *mMap; EventListener mEventListener; /**< Tracking of being deaths. */ - friend struct ScriptDeathEventDispatch; + friend struct ScriptEventDispatch; }; -struct ScriptDeathEventDispatch: EventDispatch +struct ScriptEventDispatch: EventDispatch { - ScriptDeathEventDispatch() + ScriptEventDispatch() { typedef EventListenerFactory< Script, &Script::mEventListener > Factory; died = &Factory::create< Being, &Script::processDeathEvent >::function; + removed = &Factory::create< Thing, &Script::processRemoveEvent >::function; } }; -static ScriptDeathEventDispatch scriptDeathEventDispatch; +static ScriptEventDispatch scriptEventDispatch; #endif |