Index: /orxonox/trunk/src/story_entities/world.cc
===================================================================
--- /orxonox/trunk/src/story_entities/world.cc	(revision 3619)
+++ /orxonox/trunk/src/story_entities/world.cc	(revision 3620)
@@ -20,4 +20,5 @@
 
 #include "orxonox.h"
+
 #include "p_node.h"
 #include "null_parent.h"
@@ -33,4 +34,5 @@
 #include "terrain.h"
 #include "light.h"
+
 #include "command_node.h"
 #include "glmenu_imagescreen.h"
@@ -41,4 +43,70 @@
 
 using namespace std;
+
+
+WorldInterface* WorldInterface::singletonRef = 0;
+
+
+/**
+   \brief private constructor because of singleton
+*/
+WorldInterface::WorldInterface()
+{
+  this->worldIsInitialized = false;
+  this->worldReference = NULL;
+}
+
+/**
+   \brief public deconstructor
+*/
+WorldInterface::~WorldInterface()
+{
+  this->singletonRef = NULL;
+  this->worldIsInitialized = false;
+  this->worldReference = NULL;
+}
+
+/**
+   \brief gets the singleton instance
+   \returns singleton instance
+*/
+WorldInterface* WorldInterface::getInstance()
+{
+  if( singletonRef == NULL)
+    singletonRef = new WorldInterface();
+  return singletonRef;
+}
+
+
+/**
+   \brief initializes the interface
+   \param reference to the world
+
+   if the worldinterface is not initilizes, there wont be any 
+   useable interface
+*/
+void WorldInterface::init(World* world)
+{
+  this->worldReference = world;
+  if( world!= NULL)
+    {
+      this->worldIsInitialized = true;
+      PRINTF(3)("WorldInterface up and running\n");
+    }
+}
+
+
+/**
+   \brief gets the entity list from the world
+   \return entity list
+*/
+tList<WorldEntity>* WorldInterface::getEntityList()
+{
+  if( this->worldIsInitialized)
+    return this->worldReference->getEntities();
+  PRINT(1)("Someone tried to use the WorldInterface before it has been initizlized! this can result in SEGFAULTs!\n");
+  return NULL;
+}
+
 
 
@@ -76,4 +144,6 @@
   cn->reset();
 
+  delete WorldInterface::getInstance();
+
   delete this->nullParent;
   delete this->entities;
@@ -89,7 +159,12 @@
   this->setClassName ("World");
 
+
   this->worldName = name;
   this->debugWorldNr = worldID;
   this->entities = new tList<WorldEntity>();
+
+  /* init the world interface */
+  WorldInterface* wi = WorldInterface::getInstance();
+  wi->init(this);
 
   // Enable default GL stuff
@@ -406,4 +481,14 @@
   SDL_Delay(500);
   PRINTF(3)("World::releaseLoadScreen - end\n"); 
+}
+
+
+/**
+   \brief gets the list of entities from the world
+   \returns entity list
+*/
+tList<WorldEntity>* World::getEntities()
+{
+  return this->entities;
 }
 
Index: /orxonox/trunk/src/story_entities/world.h
===================================================================
--- /orxonox/trunk/src/story_entities/world.h	(revision 3619)
+++ /orxonox/trunk/src/story_entities/world.h	(revision 3620)
@@ -12,6 +12,31 @@
 #include "p_node.h"
 
+
+class World;
+class WorldEntity;
+
+//! The game world Interface
+/**
+   this is a singleton interface, that enables world_entities to access the
+   world. for those objects, there is no easier way than over this interface!
+*/
+class WorldInterface : BaseObject {
+
+ public:
+  ~WorldInterface();
+  static WorldInterface* getInstance();
+  void init(World* world);
+  tList<WorldEntity>* getEntityList();
+
+ private:
+  WorldInterface();
+  static WorldInterface* singletonRef;    //!< singleton reference to this object
+  bool worldIsInitialized;                //!< true if the world has been initialized
+  World* worldReference;                  //!< this is a reference to the running world
+
+};
+
+
 class TrackManager;
-class WorldEntity;
 class Camera;
 class PNode;
@@ -50,4 +75,6 @@
   /* command node functions */
   bool command (Command* cmd);
+
+  tList<WorldEntity>* getEntities();
 
   /* interface to world */
Index: /orxonox/trunk/src/world_entities/player.cc
===================================================================
--- /orxonox/trunk/src/world_entities/player.cc	(revision 3619)
+++ /orxonox/trunk/src/world_entities/player.cc	(revision 3620)
@@ -20,10 +20,12 @@
 #include "player.h"
 
+#include "track_manager.h"
+#include "objModel.h"
+#include "weapon.h"
+#include "test_gun.h"
+#include "world.h"
+
+#include "list.h"
 #include "stdincl.h"
-//#include "collision.h"
-#include "objModel.h"
-#include "list.h"
-#include "weapon.h"
-#include "track_manager.h"
 
 using namespace std;
@@ -33,10 +35,14 @@
    \param isFree if the player is free
 */
-Player::Player(bool isFree) : WorldEntity(isFree)
-{
-  this->model = new OBJModel("../data/models/reaplow.obj");
+Player::Player() : WorldEntity()
+{
   this->weapons = new tList<Weapon>();
   this->activeWeapon = NULL;
-
+  /*
+    this is the debug player - actualy we would have to make a new
+     class derivated from Player for each player. for now, we just use
+     the player.cc for debug also
+  */
+  this->model = new OBJModel("../data/models/reaplow.obj");
   travelSpeed = 15.0;
   velocity = new Vector();
@@ -44,4 +50,8 @@
   bFire = false;
   acceleration = 10.0;
+  //weapons:
+  Weapon* wp = new TestGun();
+  this->weapons->add(wp);
+  this->activeWeapon = wp;  
 }
 
@@ -51,13 +61,9 @@
 Player::~Player ()
 {
-  Weapon* w = this->weapons->enumerate(); 
-  while( w != NULL) 
-    { 
-      delete w;
-      w = this->weapons->nextElement();
-    }
+  /* do not delete the weapons, they are contained in the pnode tree
+     and will be deleted there.
+     this only frees the memory allocated to save the list.
+  */
   delete this->weapons;
-  
-  //delete this->velocity;
 }
 
@@ -150,7 +156,7 @@
 {
   // player controlled movement
-  this->move (time);
+  this->move(time);
   // weapon system manipulation
-  this->fire();
+  this->weapon();
 }
 
@@ -190,5 +196,5 @@
    \brief weapon manipulation by the player
 */
-void Player::fire()
+void Player::weapon()
 {
   if( this->bFire)
Index: /orxonox/trunk/src/world_entities/player.h
===================================================================
--- /orxonox/trunk/src/world_entities/player.h	(revision 3619)
+++ /orxonox/trunk/src/world_entities/player.h	(revision 3620)
@@ -13,4 +13,5 @@
 class Weapon;
 class Vector;
+class World;
 
 //! Basic controllable WorldEntity
@@ -20,5 +21,5 @@
   
  public:
-  Player(bool isFree = false);
+  Player();
   virtual ~Player();
 
@@ -48,4 +49,5 @@
   tList<Weapon>* weapons;//!< a list of weapon
   Weapon* activeWeapon;  //!< the weapon that is currenty activated
+  World* myWorld;        //!< reference to the world object
 
   Vector* velocity;       //!< the velocity of the player.
@@ -54,5 +56,5 @@
   
   void move(float time);
-  void fire(void);
+  void weapon(void);
   
 };
Index: /orxonox/trunk/src/world_entities/test_gun.cc
===================================================================
--- /orxonox/trunk/src/world_entities/test_gun.cc	(revision 3619)
+++ /orxonox/trunk/src/world_entities/test_gun.cc	(revision 3620)
@@ -75,5 +75,8 @@
 */
 void TestGun::fire()
-{}
+{
+  printf("TestGun::fire() - firing weapon now ---------------------------\n");
+  //this->myWorld;
+}
 
 
Index: /orxonox/trunk/src/world_entities/weapon.cc
===================================================================
--- /orxonox/trunk/src/world_entities/weapon.cc	(revision 3619)
+++ /orxonox/trunk/src/world_entities/weapon.cc	(revision 3620)
@@ -23,4 +23,6 @@
 #include "objModel.h"
 #include "projectile.h"
+#include "list.h"
+#include "world.h"
 
 using namespace std;
@@ -33,5 +35,8 @@
 */
 Weapon::Weapon () : WorldEntity()
-{}
+{
+  WorldInterface* wi = WorldInterface::getInstance();
+  this->worldEntities = wi->getEntityList();
+}
 
 
@@ -174,5 +179,7 @@
 */
 void Weapon::fire()
-{}
+{
+  
+}
 
 
Index: /orxonox/trunk/src/world_entities/weapon.h
===================================================================
--- /orxonox/trunk/src/world_entities/weapon.h	(revision 3619)
+++ /orxonox/trunk/src/world_entities/weapon.h	(revision 3620)
@@ -76,4 +76,5 @@
   Projectile* projectile;
   //WeaponSound sound;
+  tList<WorldEntity>* worldEntities;
 
 };
