Index: /orxonox/branches/chris/src/player.cc
===================================================================
--- /orxonox/branches/chris/src/player.cc	(revision 2193)
+++ /orxonox/branches/chris/src/player.cc	(revision 2194)
@@ -22,4 +22,7 @@
 using namespace std;
 
+// initialize the pointers used for is_a identification
+bool (*Player::basefunc)(char*) = WorldEntity::is_a;
+char *Player::is = "Player";
 
 Player::Player(bool isFree) : WorldEntity(isFree)
@@ -88,4 +91,7 @@
 	glEnd();
 	
+	printf("Player is a Player: %d\n", is_a("Player"));
+	printf("Player is a WorldEntity: %d\n", is_a("WorldEntity"));
+	printf("Player is a Banana: %d\n", is_a("Banana"));
 	printf("Player@%f/%f/%f\n", get_placement()->r.x, get_placement()->r.y, get_placement()->r.z);
 }
@@ -128,19 +134,7 @@
 }
 
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+bool Player::is_a(char* name)
+{
+	if( !strcmp( name, is)) return true;
+	else return basefunc (name);
+}
Index: /orxonox/branches/chris/src/player.h
===================================================================
--- /orxonox/branches/chris/src/player.h	(revision 2193)
+++ /orxonox/branches/chris/src/player.h	(revision 2194)
@@ -18,4 +18,6 @@
   ~Player ();
 
+	static bool is_a(char* name);
+
 	virtual void post_spawn ();
   virtual void tick (float time);
@@ -24,5 +26,5 @@
   virtual void collide (WorldEntity* other,  Uint32 ownhitflags, Uint32 otherhitflags);
  	virtual void command (Command* cmd);
-  
+   
   virtual void draw ();
   virtual void get_lookat (Location* locbuf);
@@ -31,4 +33,7 @@
 
  private:
+ 	static bool (*basefunc)(char*);
+  static char *is;
+
  	bool bUp, bDown, bLeft, bRight, bAscend, bDescend;
  	bool bFire;
Index: /orxonox/branches/chris/src/world.cc
===================================================================
--- /orxonox/branches/chris/src/world.cc	(revision 2193)
+++ /orxonox/branches/chris/src/world.cc	(revision 2194)
Index: /orxonox/branches/chris/src/world_entity.cc
===================================================================
--- /orxonox/branches/chris/src/world_entity.cc	(revision 2193)
+++ /orxonox/branches/chris/src/world_entity.cc	(revision 2194)
@@ -23,4 +23,8 @@
 
 using namespace std;
+
+// initialize the pointers used for is_a identification
+bool (*WorldEntity::basefunc)(char*) = WorldEntity::is_none;
+char *WorldEntity::is = "WorldEntity";
 
 /**
@@ -183,2 +187,29 @@
 */
 void WorldEntity::left_world () {}
+
+/**
+	\brief this method can be used to determine what type of WorldEntity a particular pointer represents at runtime
+	\param name: a string specifying the type (use the name of the class)
+	\return true if the entity is in fact of that type or a derivation thereof false if the entity is not related to the specifiead type
+
+	Since this funtion is declared static, it has to be redeclaed and reimplemented in every derivation of WorldEntity, but since it is written
+	very generally you just have to copy paste this function and initialize the two static is_a variables (basefunc and is) correctly.
+	Note that these have to be redeclared as well or you will get a compiler error.
+*/
+bool WorldEntity::is_a (char* name)
+{
+	if( !strcmp( name, is)) return true;
+	else return basefunc (name);
+}
+
+/**
+	\brief basefunc of WorldEntity
+	\param name: not relevant
+	\return false
+	
+	dummy is_a() implementation that returns false only
+*/
+bool WorldEntity::is_none (char* name)
+{
+	return false;
+}
Index: /orxonox/branches/chris/src/world_entity.h
===================================================================
--- /orxonox/branches/chris/src/world_entity.h	(revision 2193)
+++ /orxonox/branches/chris/src/world_entity.h	(revision 2194)
@@ -25,4 +25,6 @@
 
  	bool isFree ();
+
+	static bool is_a(char* name);
  	
   //void addAbility(Ability* ability);
@@ -35,11 +37,15 @@
   virtual void collide (WorldEntity* other,  Uint32 ownhitflags, Uint32 otherhitflags);
  	virtual void command (Command* cmd);
-  
+    
   virtual void draw ();
   virtual void get_lookat (Location* locbuf);
 
 	virtual void left_world ();
-
+ 	
  private:
+ 	static bool is_none (char* name); 	
+ 	static bool (*basefunc)(char*);
+ 	static char *is;
+ 
   const bool bFree;	
   bool bCollide;
