X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fgame_object.hpp;h=5acc8333830eabb73fa216c02ce32c863494bdcd;hb=9f9a92cd9d8433c6d4d63b0178fd038a95b9e1a1;hp=d9541ed1d02a82acd5a3e47ed4eabfe4471dc526;hpb=a113d3bd1feddd510e3b2852b0d42522735eee40;p=supertux.git diff --git a/src/game_object.hpp b/src/game_object.hpp index d9541ed1d..5acc83338 100644 --- a/src/game_object.hpp +++ b/src/game_object.hpp @@ -34,7 +34,6 @@ class ObjectRemoveListener; * draw() functions. Both are called once per frame. * - Providing a safe way to remove the object by calling the remove_me * functions. - * - a 32bit bitset for flags... */ class GameObject : public RefCounter { @@ -69,26 +68,17 @@ 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; - } - - // flags - enum { - /// the tile so you can stand on it - FLAG_SOLID = (1 << 0), - /// the object can be carried around (inherits from Portable) - FLAG_PORTABLE = (1 << 1) - }; + 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); - int get_flags() const + const std::string& get_name() const { - return flags; + return name; } private: @@ -105,7 +95,11 @@ private: RemoveListenerListEntry* remove_listeners; protected: - int flags; + /** + * a name for the gameobject, this is mostly a hint for scripts and for + * debugging, don't rely on names being set or being unique + */ + std::string name; }; #endif /*SUPERTUX_GAMEOBJECT_H*/