-// $Id: game_object.h 2293 2005-03-25 20:39:56Z matzebraun $
+// $Id$
//
-// SuperTux - A Jump'n Run
-// Copyright (C) 2004 Matthias Braun <matze@braunis.de>
+// SuperTux
+// Copyright (C) 2006 Matthias Braun <matze@braunis.de>
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
#define SUPERTUX_GAMEOBJECT_H
#include <string>
+#include "refcounter.hpp"
class DrawingContext;
class ObjectRemoveListener;
* functions.
* - a 32bit bitset for flags...
*/
-class GameObject
+class GameObject : public RefCounter
{
public:
GameObject();
/** 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
*/
// flags
enum {
/// the tile so you can stand on it
- FLAG_SOLID = 0x0001,
- /// can be used to temporatily disable collision detection
- FLAG_NO_COLLDET = 0x0002
+ FLAG_SOLID = (1 << 0),
+ /// the object can be carried around (inherits from Portable)
+ FLAG_PORTABLE = (1 << 1)
};
int get_flags() const