diff options
author | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2012-05-27 23:26:19 +0200 |
---|---|---|
committer | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2013-01-09 17:12:15 +0100 |
commit | 0b339e547b77f80d6e81313bfb38249ce8995553 (patch) | |
tree | f22fee0142f72042430ace070a6e6ef4493e7c39 /src/game-server/being.h | |
parent | 16074a7c2c8197a061281a6880ddbc3967d8ea0c (diff) | |
download | manaserv-0b339e547b77f80d6e81313bfb38249ce8995553.tar.gz manaserv-0b339e547b77f80d6e81313bfb38249ce8995553.tar.xz manaserv-0b339e547b77f80d6e81313bfb38249ce8995553.zip |
Replaced EventListener with signals based on libsigc++
This replaces the rather hard to understand event dispatcher with a
probably even harder to understand templated library, but fortunately
we can rely on the available documentation.
Hopefully it will also help with the readability of our code and with
adding additional signals to other classes.
Added libsigc++ to README and Travis CI configuration.
Reviewed-by: Erik Schilling
Diffstat (limited to 'src/game-server/being.h')
-rw-r--r-- | src/game-server/being.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/game-server/being.h b/src/game-server/being.h index 0083be1..a08df01 100644 --- a/src/game-server/being.h +++ b/src/game-server/being.h @@ -297,10 +297,7 @@ class Being : public Actor void setTarget(Being *target) { mTarget = target; } - /** - * Overridden in order to reset the old position upon insertion. - */ - virtual void inserted(); + sigc::signal<void, Being *> signal_died; protected: /** @@ -332,6 +329,11 @@ class Being : public Actor Being(const Being &rhs); Being &operator=(const Being &rhs); + /** + * Connected to signal_inserted to reset the old position. + */ + void inserted(Entity *); + Path mPath; BeingDirection mDirection; /**< Facing direction. */ |