projects
/
supertux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Addded property to Worldmap Spawnpoint to let Tux automatically start walking (or...
[supertux.git]
/
src
/
game_object.hpp
diff --git
a/src/game_object.hpp
b/src/game_object.hpp
index
6e0c4ee
..
76b0883
100644
(file)
--- 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) 200
4
Matthias Braun <matze@braunis.de>
+// SuperTux
+// Copyright (C) 200
6
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
//
// 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,8
@@
#define SUPERTUX_GAMEOBJECT_H
#include <string>
#define SUPERTUX_GAMEOBJECT_H
#include <string>
+#include "refcounter.hpp"
+#include "lisp/lisp.hpp"
class DrawingContext;
class ObjectRemoveListener;
class DrawingContext;
class ObjectRemoveListener;
@@
-33,9
+35,8
@@
class ObjectRemoveListener;
* draw() functions. Both are called once per frame.
* - Providing a safe way to remove the object by calling the remove_me
* functions.
* 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
+class GameObject
: public RefCounter
{
public:
GameObject();
{
public:
GameObject();
@@
-55,15
+56,17
@@
public:
/** returns true if the object is not scheduled to be removed yet */
bool is_valid() const
/** 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;
}
/** 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
+
+ /** registers a remove listener which will be called if the object
* gets removed/destroyed
*/
void add_remove_listener(ObjectRemoveListener* listener)
* gets removed/destroyed
*/
void add_remove_listener(ObjectRemoveListener* listener)
@@
-74,16
+77,10
@@
public:
remove_listeners = entry;
}
remove_listeners = entry;
}
-
- // flags
- enum {
- /// the tile so you can stand on it
- FLAG_SOLID = 0x0001,
- };
-
int get_flags
() const
+
const std::string& get_name
() const
{
{
- return
flags;
+ return
name;
}
private:
}
private:
@@
-100,7
+97,11
@@
private:
RemoveListenerListEntry* remove_listeners;
protected:
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*/
};
#endif /*SUPERTUX_GAMEOBJECT_H*/