X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fgame_object.hpp;h=7d4b05f713c1cc4b6f3c795776ae0e1ade390d5d;hb=113cdbf07f441329690714a53a436503ab1d4b35;hp=547353be58048af667664322416286582baae27a;hpb=d62647592b4ccffa89794af6fa03faaced46999d;p=supertux.git diff --git a/src/game_object.hpp b/src/game_object.hpp index 547353be5..7d4b05f71 100644 --- a/src/game_object.hpp +++ b/src/game_object.hpp @@ -1,7 +1,7 @@ -// $Id: game_object.h 2293 2005-03-25 20:39:56Z matzebraun $ +// $Id$ // -// SuperTux - A Jump'n Run -// Copyright (C) 2004 Matthias Braun +// SuperTux +// Copyright (C) 2006 Matthias Braun // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License @@ -20,6 +20,7 @@ #define SUPERTUX_GAMEOBJECT_H #include +#include "refcounter.hpp" class DrawingContext; class ObjectRemoveListener; @@ -35,7 +36,7 @@ class ObjectRemoveListener; * functions. * - a 32bit bitset for flags... */ -class GameObject +class GameObject : public RefCounter { public: GameObject(); @@ -55,14 +56,16 @@ public: /** returns true if the object is not scheduled to be removed yet */ bool is_valid() const - { - return !wants_to_die; - } + { + return !wants_to_die; + } + /** schedules this object to be removed at the end of the frame */ void remove_me() { wants_to_die = true; } + /** registers a remove listener which will be called if the object * gets removed/destroyed */ @@ -78,7 +81,9 @@ public: // flags enum { /// the tile so you can stand on it - FLAG_SOLID = 0x0001 + FLAG_SOLID = (1 << 0), + /// the object can be carried around (inherits from Portable) + FLAG_PORTABLE = (1 << 1) }; int get_flags() const