X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fgame_object.hpp;h=7c4b59f6c8b069aa9129b07a4b69a4a02c28f930;hb=8b67b0dc71efddc4b668bde525ba94d701f622ac;hp=f463f88d441c825699d14619149406afb8c261df;hpb=a983f6648d43492632c41e2b7519b70458b53cf4;p=supertux.git diff --git a/src/game_object.hpp b/src/game_object.hpp index f463f88d4..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 {