X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fgame_object.hpp;h=7c4b59f6c8b069aa9129b07a4b69a4a02c28f930;hb=519979665a5ce1b5aed256cefc1eacbf845953cd;hp=76b0883c605f6f77bd2047accf79f44bea968e68;hpb=4a486d92343d1824b311c234e9321e08f280fe68;p=supertux.git diff --git a/src/game_object.hpp b/src/game_object.hpp index 76b0883c6..7c4b59f6c 100644 --- a/src/game_object.hpp +++ b/src/game_object.hpp @@ -21,14 +21,15 @@ #include #include "refcounter.hpp" -#include "lisp/lisp.hpp" class DrawingContext; class ObjectRemoveListener; /** - * This is a base class for all game objects. Each sector of a level will hold a - * list of active GameObject while the game is played. + * Base class for all the things that make up Levels' Sectors. + * + * Each sector of a level will hold a list of active GameObject while the + * game is played. * * This class is responsible for: * - Updating and Drawing the object. This should happen in the update() and @@ -69,14 +70,13 @@ public: /** registers a remove listener which will be called if the object * gets removed/destroyed */ - void add_remove_listener(ObjectRemoveListener* listener) - { - RemoveListenerListEntry* entry = new RemoveListenerListEntry(); - entry->next = remove_listeners; - entry->listener = listener; - - remove_listeners = entry; - } + void add_remove_listener(ObjectRemoveListener* listener); + + /** + * unregisters a remove listener, so it will no longer be called if the object + * gets removed/destroyed + */ + void del_remove_listener(ObjectRemoveListener* listener); const std::string& get_name() const { @@ -105,4 +105,3 @@ protected: }; #endif /*SUPERTUX_GAMEOBJECT_H*/ -