Index: /branches/objectmanager/src/orxonox.cc
===================================================================
--- /branches/objectmanager/src/orxonox.cc	(revision 6133)
+++ /branches/objectmanager/src/orxonox.cc	(revision 6134)
@@ -43,5 +43,4 @@
 #include "text_engine.h"
 #include "event_handler.h"
-#include "garbage_collector.h"
 
 #include "factory.h"
@@ -96,5 +95,4 @@
   // game-specific
   delete GameLoader::getInstance();
-  delete GarbageCollector::getInstance();
 
   // class-less services/factories
Index: /branches/objectmanager/src/story_entities/world.cc
===================================================================
--- /branches/objectmanager/src/story_entities/world.cc	(revision 6133)
+++ /branches/objectmanager/src/story_entities/world.cc	(revision 6134)
@@ -38,5 +38,4 @@
 #include "shell.h"
 
-#include "garbage_collector.h"
 #include "fast_factory.h"
 #include "animation_player.h"
@@ -122,9 +121,4 @@
   delete this->shell;
   PRINTF(3)("World::~World() - deleting current world\n");
-
-
-  // here everything that is alocated by the World is deleted
-  delete this->entities;
-  State::setWorldEntityList(NULL);
 
   delete this->localPlayer;
@@ -181,5 +175,4 @@
   this->music = NULL;
   this->shell = NULL;
-  this->entities = NULL;
   this->localPlayer = NULL;
   this->localCamera = NULL;
@@ -216,5 +209,4 @@
 {
   State::setObjectManager(&this->objectManager);
-  State::setWorldEntityList(this->entities = new tList<WorldEntity>());
   this->cycle = 0;
 
@@ -588,14 +580,4 @@
 
 /**
- *  gets the list of entities from the world
- * @returns entity list
-*/
-tList<WorldEntity>* World::getEntities()
-{
-  return this->entities;
-}
-
-
-/**
  *  this returns the current game time
  * @returns elapsed game time
@@ -605,23 +587,4 @@
   return this->gameTime;
 }
-
-
-/**
- *  function to put your own debug stuff into it. it can display informations about
-   the current class/procedure
-*/
-void World::debug()
-{
-  PRINTF(0)("Printing out the List of alive WorldEntities:\n");
-  tIterator<WorldEntity>* iterator = this->entities->getIterator();
-  WorldEntity* entity = iterator->firstElement();
-  while( entity != NULL)
-  {
-    PRINTF(0)("%s::%s\n", entity->getClassName(), entity->getName());
-    entity = iterator->nextElement();
-  }
-  delete iterator;
-}
-
 
 /**
@@ -640,5 +603,4 @@
     {
       ++this->cycle;
-      PRINTF(4)("World::mainloop() - number of entities: %i\n", this->entities->getSize());
       // Network
       this->synchronize ();
@@ -685,4 +647,11 @@
 }
 
+void World::tick(std::list<WorldEntity*> entityList, float dt)
+{
+  std::list<WorldEntity*>::iterator entity;
+  for (entity = entityList.begin(); entity != entityList.end(); entity++)
+    (*entity)->tick(dt);
+
+}
 
 /**
@@ -721,13 +690,18 @@
       this->gameTime += this->dtS;
 
-
-      tIterator<WorldEntity>* iterator = this->entities->getIterator();
-      WorldEntity* entity = iterator->firstElement();
-      while( entity != NULL)
-        {
-          entity->tick (this->dtS);
-          entity = iterator->nextElement();
-        }
-      delete iterator;
+      this->tick(this->objectManager.getObjectList(OM_DEAD_TICK), this->dtS);
+      this->tick(this->objectManager.getObjectList(OM_COMMON), this->dtS);
+      this->tick(this->objectManager.getObjectList(OM_GROUP_00), this->dtS);
+      this->tick(this->objectManager.getObjectList(OM_GROUP_01), this->dtS);
+      this->tick(this->objectManager.getObjectList(OM_GROUP_01_PROJ), this->dtS);
+
+//       tIterator<WorldEntity>* iterator = this->entities->getIterator();
+//       WorldEntity* entity = iterator->firstElement();
+//       while( entity != NULL)
+//         {
+//           entity->tick (this->dtS);
+//           entity = iterator->nextElement();
+//         }
+//       delete iterator;
 
       /* update tick the rest */
@@ -739,5 +713,4 @@
 
       ParticleEngine::getInstance()->tick(this->dtS);
-      GarbageCollector::getInstance()->tick(this->dtS);
 
 
@@ -764,5 +737,4 @@
 void World::update()
 {
-  GarbageCollector::getInstance()->update();
   GraphicsEngine::getInstance()->update(this->dtS);
   PNode::getNullParent()->updateNode (this->dtS);
@@ -813,18 +785,11 @@
   engine->draw(State::getObjectManager()->getObjectList(OM_GROUP_01));
   engine->draw(State::getObjectManager()->getObjectList(OM_GROUP_01_PROJ));
-  
-  
-  /* draw entities */
-  WorldEntity* entity;
-  glLoadIdentity();
-  tIterator<WorldEntity>* iterator = this->entities->getIterator();
-  entity = iterator->firstElement();
-  while( entity != NULL )
-  {
-    if( entity->isVisible() ) entity->draw();
-    if( unlikely( this->showBV)) entity->drawBVTree(3, 226);  // to draw the bounding boxes of the objects at level 2 for debug purp
-    entity = iterator->nextElement();
-  }
-  delete iterator;
+
+//   {
+//     if( entity->isVisible() ) entity->draw();
+  //FIXME
+//     if( unlikely( this->showBV)) entity->drawBVTree(3, 226);  // to draw the bounding boxes of the objects at level 2 for debug purp
+//     entity = iterator->nextElement();
+//   }
 
   glCallList (objectList);
@@ -845,5 +810,5 @@
 void World::spawn(WorldEntity* entity)
 {
-  this->entities->add (entity);
+//   this->entities->add (entity);
   entity->postSpawn ();
 }
@@ -858,5 +823,5 @@
 void World::spawn(WorldEntity* entity, Vector* absCoor, Quaternion* absDir)
 {
-  this->entities->add (entity);
+//   this->entities->add (entity);
 
   entity->setAbsCoor (*absCoor);
@@ -884,5 +849,5 @@
       entity->setRelDir (*relDir);
 
-      this->entities->add (entity);
+//       this->entities->add (entity);
 
       entity->postSpawn ();
Index: /branches/objectmanager/src/story_entities/world.h
===================================================================
--- /branches/objectmanager/src/story_entities/world.h	(revision 6133)
+++ /branches/objectmanager/src/story_entities/world.h	(revision 6134)
@@ -23,6 +23,4 @@
 class Shell;
 class OggPlayer;
-
-template<class T> class tList;
 
 //! The game world
@@ -61,6 +59,4 @@
   bool command (Command* cmd);
 
-  tList<WorldEntity>* getEntities();
-
   /* interface to world */
   void spawn (WorldEntity* entity);
@@ -84,4 +80,5 @@
   void synchronize ();
   void handleInput ();
+  void tick (std::list<WorldEntity*> worldEntity, float dt);
   void tick ();
   void update ();
@@ -120,5 +117,5 @@
 
     GLuint objectList;                  //!< temporary: @todo this will be ereased soon
-    tList<WorldEntity>* entities;       //!< A template List of all entities. Every moving thing should be included here, and world automatically updates them.
+
     Player* localPlayer;                //!< The Player, you fly through the level.
 };
Index: /branches/objectmanager/src/util/Makefile.am
===================================================================
--- /branches/objectmanager/src/util/Makefile.am	(revision 6133)
+++ /branches/objectmanager/src/util/Makefile.am	(revision 6134)
@@ -7,5 +7,4 @@
 			object_manager.cc \
                         loading/factory.cc \
-			garbage_collector.cc \
 			state.cc \
 			user_control.cc \
@@ -19,9 +18,8 @@
 			track/pilot_node.cc \
 			track/track_manager.cc \
-			track/track_node.cc 
+			track/track_node.cc
 
 noinst_HEADERS =        fast_factory.h \
 			object_manager.h \
-			garbage_collector.h \
 			state.h \
 			user_control.h \
Index: anches/objectmanager/src/util/garbage_collector.cc
===================================================================
--- /branches/objectmanager/src/util/garbage_collector.cc	(revision 6133)
+++ 	(revision )
@@ -1,185 +1,0 @@
-/*
-   orxonox - the future of 3D-vertical-scrollers
-
-   Copyright (C) 2004 orx
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   ### File Specific:
-   main-programmer: Patrick Boenzli
-   co-programmer: ...
-*/
-
-#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_GARBAGE_COLLECTOR
-
-#include "garbage_collector.h"
-
-#include "state.h"
-#include "world_entity.h"
-#include "fast_factory.h"
-
-#include "list.h"
-
-using namespace std;
-
-GarbageCollector* GarbageCollector::singletonRef = 0;
-
-/**
- *  standard constructor
-*/
-GarbageCollector::GarbageCollector ()
-{
-   this->setClassID(CL_GARBAGE_COLLECTOR, "GarbageCollector");
-   this->setName("GarbageCollector");
-
-   this->collectedObjects = NULL;
-   this->unusedContainers = NULL;
-
-   this->time = 0;
-   this->delay = 5.0f; /* clean up all 5.0 seconds */
-}
-
-
-/**
- *  standard deconstructor
-*/
-GarbageCollector::~GarbageCollector ()
-{
-  // delete what has to be deleted here
-}
-
-/**
- *  this sets the collection delay
- * @param delay: the delay
-
-   after this delay, the garbage collector starts its work and begins to collect unused object
-   to delete them afterwards. only objects in the worldentity list from the world object are lookded
-   at.
-*/
-void GarbageCollector::setCollectionDelay(float delay)
-{
-  this->delay = delay;
-}
-
-
-/**
- *  this foreces a garbage collection
-
-   if this function is called, the gc tries to initiate the garbage collection routines. actually
-   this should always work.
-*/
-void GarbageCollector::forceCollection()
-{
-  /* just make the time slitely bigger than the delay */
-  this->time = this->delay + 1;
-  /* and update, to get rid of the unused objects */
-  this->update();
-}
-
-
-/**
- * collect an Object, that should be scheduled for clearing.
- * @param object the Object to schedule.
- */
-void GarbageCollector::collect(BaseObject* object)
-{
-  State::getWorldEntityList()->remove(dynamic_cast<WorldEntity*>(object));
-  FastObjectMember* tmpC;
-  if (unlikely(this->unusedContainers == NULL))
-  {
-    tmpC = new FastObjectMember;
-  }
-  else
-  {
-    tmpC = this->unusedContainers;
-    this->unusedContainers = this->unusedContainers->next;
-  }
-
-  tmpC->next = this->collectedObjects;
-  tmpC->objectPointer = object;
-  this->collectedObjects = tmpC;
-}
-
-/**
- *  this ticks the GarbageCollector to give it the time pulse
- * @param time: the time passed since last tick
-
-   like every other tick function eg. worldentity
-*/
-void GarbageCollector::tick(float time)
-{
-  this->time += time;
-}
-
-
-void GarbageCollector::update()
-{
-  if (this->time < this->delay || this->collectedObjects == NULL)
-    return;
-  else
-  {
-    FastObjectMember* tmpC = this->collectedObjects;
-    FastObjectMember* moveC;
-    while (tmpC != NULL)
-    {
-      //WorldEntity* entity = dynamic_cast<WorldEntity*>(tmpC->objectPointer);
-      //State::getWorldEntityList()->remove(entity);
-      //entity->remove();
-      FastFactory::kill(tmpC->objectPointer, true);
-
-      moveC = tmpC->next;
-      tmpC->next = this->unusedContainers;
-      this->unusedContainers = tmpC;
-      tmpC = moveC;
-    }
-    this->collectedObjects = NULL;
-  }
-}
-
-/**
- *  this updated the gargabe collection, if the time is ready
-*/
-// void GarbageCollector::update()
-// {
-//   if( this->time < this->delay)
-//     return;
-//   /* garbage collect */
-//   PRINTF(3)("=============================\n");
-//   PRINTF(3)("Processing Garbage Collection\n");
-//   PRINTF(3)("=============================\n");
-//   int counter = 0;
-//
-//   tList<WorldEntity>* list = State::getWorldEntityList();
-//
-//   tIterator<WorldEntity>* iterator = list->getIterator();
-//   WorldEntity* entity = iterator->firstElement();
-//   while( entity != NULL)
-//     {
-//       if( entity->isFinalized())
-//         {
-//           PRINTF(4)("= finalizing object\n");
-//           ++counter;
-//
-//           /* first remove out of entity list */
-//           list->remove(entity);
-//           /* second remove out of pnode tree */
-//           entity->remove();
-//           /* then finaly delete reference */
-//           //delete entity;
-//           //FastFactory::kill();
-//           //ObjectManager::getInstance()->addToDeadList(entity->getClassID() & CL_MASK_LOWLEVEL_CLASS, entity);
-//         }
-//       entity = iterator->nextElement();
-//     }
-//
-//   PRINTF(3)("= collected %i unused objects\n", counter);
-//   PRINTF(3)("=============================\n");
-//
-//   //ObjectManager::getInstance()->debug();
-//
-//   /* reset time to count again up to this->delay */
-//   this->time = 0;
-// }
Index: anches/objectmanager/src/util/garbage_collector.h
===================================================================
--- /branches/objectmanager/src/util/garbage_collector.h	(revision 6133)
+++ 	(revision )
@@ -1,48 +1,0 @@
-/*!
- * @file garbage_collector.h
- */
-
-#ifndef _GARBAGE_COLLECTOR_H
-#define _GARBAGE_COLLECTOR_H
-
-#include "base_object.h"
-
-// FORWARD DECLARATION
-class FastObjectMember;
-
-//! this class maintains the garbage collection.
-/**
- * you can pass everything to this class that you want to be collected
- * just use GarbageCollector->collect(POINTER); to pass a collectable to the GarbageCollector
- * it will then be handled acording to the class
-*/
-class GarbageCollector : public BaseObject {
-
- public:
-  virtual ~GarbageCollector();
-  /** @returns a Pointer to the only object of this Class */
-  inline static GarbageCollector* getInstance() { if (!singletonRef) singletonRef = new GarbageCollector();  return singletonRef; };
-
-  void setCollectionDelay(float delay);
-
-  void forceCollection();
-
-  void collect(BaseObject* object);
-
-  void tick(float time);
-  void update();
-
- private:
-  GarbageCollector();
-
- private:
-  static GarbageCollector*    singletonRef;           //!< The reference to this class (singleton)
-
-  FastObjectMember*           collectedObjects;       //!< A list of recently collected Objects, that want to be deleted.
-  FastObjectMember*           unusedContainers;       //!< A list of unused containers.
-  float                       delay;                  //!< this is the delay to wait until collection.
-  float                       time;                   //!< the current time
-
-};
-
-#endif /* _GARBAGE_COLLECTOR_H */
Index: /branches/objectmanager/src/util/state.cc
===================================================================
--- /branches/objectmanager/src/util/state.cc	(revision 6133)
+++ /branches/objectmanager/src/util/state.cc	(revision 6134)
@@ -30,5 +30,4 @@
 
 ObjectManager* State::objectManager = NULL;
-tList<WorldEntity>* State::worldEntityList = NULL;
 
 /**
Index: /branches/objectmanager/src/util/state.h
===================================================================
--- /branches/objectmanager/src/util/state.h	(revision 6133)
+++ /branches/objectmanager/src/util/state.h	(revision 6134)
@@ -10,5 +10,4 @@
 class PNode;
 class WorldEntity;
-template<class T> class tList;
 class ObjectManager;
 
@@ -43,8 +42,4 @@
   /// WORLD_ENTITY_LIST ///
   /////////////////////////
-  /** @param worldEntityList The World's List of WorldEntities */
-  static inline void setWorldEntityList(tList<WorldEntity>* worldEntityList) { State::worldEntityList = worldEntityList; };
-  /** @returns the List of WorldEntities */
-  static inline tList<WorldEntity>* getWorldEntityList() { return State::worldEntityList; };
 
  private:
@@ -56,7 +51,4 @@
   static ObjectManager*         objectManager;      //!< A referenct to the current ObjectManager
 
-  static tList<WorldEntity>*    worldEntityList;    //!< The List of the worldEntities
-
-  //tStack<
 };
 
Index: /branches/objectmanager/src/world_entities/npcs/npc.cc
===================================================================
--- /branches/objectmanager/src/world_entities/npcs/npc.cc	(revision 6133)
+++ /branches/objectmanager/src/world_entities/npcs/npc.cc	(revision 6134)
@@ -50,5 +50,5 @@
       WorldEntity* powerUp = new TurretPowerUp();
       powerUp->setAbsCoor(this->getAbsCoor());
-      State::getWorldEntityList()->add(powerUp);
+      powerUp->toList(OM_COMMON);
     }
     else if ((float)rand()/RAND_MAX < .3)
@@ -56,7 +56,7 @@
       WorldEntity* powerUp = new LaserPowerUp();
       powerUp->setAbsCoor(this->getAbsCoor());
-      State::getWorldEntityList()->add(powerUp);
+      powerUp->toList(OM_COMMON);
     }
-    State::getWorldEntityList()->remove(this);
+    this->toList(OM_DEAD);
     this->removeNode();
 
@@ -68,5 +68,5 @@
   {
     this->setVisibiliy(false);
-    State::getWorldEntityList()->remove(this);
+    this->toList(OM_DEAD);
     this->removeNode();
   }
Index: /branches/objectmanager/src/world_entities/power_ups/laser_power_up.cc
===================================================================
--- /branches/objectmanager/src/world_entities/power_ups/laser_power_up.cc	(revision 6133)
+++ /branches/objectmanager/src/world_entities/power_ups/laser_power_up.cc	(revision 6134)
@@ -80,5 +80,5 @@
  // PRINTF(3)("collision %s vs %s @ (%f,%f,%f)\n", this->getClassName(), entity->getClassName(), location.x, location.y, location.z);
  if (entity->isA(CL_PLAYABLE))
-  State::getWorldEntityList()->remove(this);
+  this->toList(OM_DEAD);
 }
 
Index: /branches/objectmanager/src/world_entities/power_ups/turret_power_up.cc
===================================================================
--- /branches/objectmanager/src/world_entities/power_ups/turret_power_up.cc	(revision 6133)
+++ /branches/objectmanager/src/world_entities/power_ups/turret_power_up.cc	(revision 6134)
@@ -80,5 +80,5 @@
  // PRINTF(3)("collision %s vs %s @ (%f,%f,%f)\n", this->getClassName(), entity->getClassName(), location.x, location.y, location.z);
  if (entity->isA(CL_PLAYABLE))
-  State::getWorldEntityList()->remove(this);
+   this->toList(OM_DEAD);
 }
 
Index: /branches/objectmanager/src/world_entities/test_entity.cc
===================================================================
--- /branches/objectmanager/src/world_entities/test_entity.cc	(revision 6133)
+++ /branches/objectmanager/src/world_entities/test_entity.cc	(revision 6134)
@@ -71,5 +71,5 @@
     PRINTF(3)("collision %s vs %s @ (%f,%f,%f)\n", this->getName(), entity->getName(), location.x, location.y, location.z);
   this->setVisibiliy(false);
-  State::getWorldEntityList()->remove(this);
+  this->toList(OM_DEAD);
   }
 }
Index: /branches/objectmanager/src/world_entities/weapons/aim.cc
===================================================================
--- /branches/objectmanager/src/world_entities/weapons/aim.cc	(revision 6133)
+++ /branches/objectmanager/src/world_entities/weapons/aim.cc	(revision 6134)
@@ -104,5 +104,6 @@
 void Aim::searchTarget(float range)
 {
-  tIterator<WorldEntity>* iterator = State::getWorldEntityList()->getIterator();
+  //FIXME//
+/*  tIterator<WorldEntity>* iterator = State::getWorldEntityList()->getIterator();
   WorldEntity* entity = iterator->firstElement();
   while (likely(entity != NULL))
@@ -121,5 +122,5 @@
   }
 
-  delete iterator;
+  delete iterator;*/
 }
 
Index: /branches/objectmanager/src/world_entities/weapons/bomb.cc
===================================================================
--- /branches/objectmanager/src/world_entities/weapons/bomb.cc	(revision 6133)
+++ /branches/objectmanager/src/world_entities/weapons/bomb.cc	(revision 6134)
@@ -174,5 +174,4 @@
 void Bomb::activate()
 {
-  State::getWorldEntityList()->add(this);
 
 }
@@ -180,6 +179,5 @@
 void Bomb::deactivate()
 {
-  this->toList(OM_NULL);
-  State::getWorldEntityList()->remove(this);
+  this->toList(OM_DEAD);
   this->lifeCycle = 0.0f;
   Bomb::fastFactory->kill(this);
Index: /branches/objectmanager/src/world_entities/weapons/guided_missile.cc
===================================================================
--- /branches/objectmanager/src/world_entities/weapons/guided_missile.cc	(revision 6133)
+++ /branches/objectmanager/src/world_entities/weapons/guided_missile.cc	(revision 6134)
@@ -85,5 +85,4 @@
 void GuidedMissile::activate()
 {
-  State::getWorldEntityList()->add(this);
   if (unlikely(GuidedMissile::trailParticles == NULL))
   {
@@ -129,7 +128,5 @@
   this->lifeCycle = 0.0;
 
-  this->toList(OM_NULL);
-//  GarbageCollector::getInstance()->collect(this);
-  State::getWorldEntityList()->remove(this);
+  this->toList(OM_DEAD);
   this->removeNode();
   GuidedMissile::fastFactory->kill(this);
Index: /branches/objectmanager/src/world_entities/weapons/laser.cc
===================================================================
--- /branches/objectmanager/src/world_entities/weapons/laser.cc	(revision 6133)
+++ /branches/objectmanager/src/world_entities/weapons/laser.cc	(revision 6134)
@@ -77,5 +77,4 @@
 void Laser::activate()
 {
-  State::getWorldEntityList()->add(this);
   if (unlikely(Laser::explosionParticles == NULL))
   {
@@ -99,5 +98,5 @@
   this->toList(OM_NULL);
 
-  State::getWorldEntityList()->remove(this);
+  this->toList(OM_DEAD);
   this->removeNode();
   Laser::fastFactory->kill(this);
Index: /branches/objectmanager/src/world_entities/weapons/projectile.cc
===================================================================
--- /branches/objectmanager/src/world_entities/weapons/projectile.cc	(revision 6133)
+++ /branches/objectmanager/src/world_entities/weapons/projectile.cc	(revision 6134)
@@ -22,6 +22,4 @@
 #include "weapon.h"
 #include "model.h"
-
-#include "garbage_collector.h"
 
 using namespace std;
Index: /branches/objectmanager/src/world_entities/weapons/rocket.cc
===================================================================
--- /branches/objectmanager/src/world_entities/weapons/rocket.cc	(revision 6133)
+++ /branches/objectmanager/src/world_entities/weapons/rocket.cc	(revision 6134)
@@ -82,5 +82,4 @@
 void Rocket::activate()
 {
-  State::getWorldEntityList()->add(this);
   if (unlikely(Rocket::trailParticles == NULL))
   {
@@ -128,5 +127,5 @@
 
 //  GarbageCollector::getInstance()->collect(this);
-  State::getWorldEntityList()->remove(this);
+  this->toList(OM_DEAD);
   Rocket::fastFactory->kill(this);
 }
Index: /branches/objectmanager/src/world_entities/weapons/test_bullet.cc
===================================================================
--- /branches/objectmanager/src/world_entities/weapons/test_bullet.cc	(revision 6133)
+++ /branches/objectmanager/src/world_entities/weapons/test_bullet.cc	(revision 6134)
@@ -82,5 +82,4 @@
 void TestBullet::activate()
 {
-  State::getWorldEntityList()->add(this);
   if (unlikely(TestBullet::trailParticles == NULL))
   {
@@ -121,6 +120,4 @@
   this->toList(OM_NULL);
 
-//  GarbageCollector::getInstance()->collect(this);
-  State::getWorldEntityList()->remove(this);
   TestBullet::fastFactory->kill(this);
 }
