Index: branches/new_class_id/src/lib/util/loading/new_resource_manager.cc
===================================================================
--- branches/new_class_id/src/lib/util/loading/new_resource_manager.cc	(revision 9799)
+++ branches/new_class_id/src/lib/util/loading/new_resource_manager.cc	(revision 9800)
@@ -22,156 +22,158 @@
 #include <cassert>
 
-ObjectListDefinition(NewResourceManager);
+
+namespace Resources
+{
+  ObjectListDefinition(NewResourceManager);
+  //! Singleton Reference to the NewResourceManager
+  NewResourceManager* NewResourceManager::_singletonRef = NULL;
 
 
-//! Singleton Reference to the NewResourceManager
-NewResourceManager* NewResourceManager::_singletonRef = NULL;
+  /**
+   * @brief standard constructor
+  */
+  NewResourceManager::NewResourceManager ()
+  {
+    this->registerObject(this, NewResourceManager::_objectList);
+    this->setName("NewResourceManager");
+
+    //this->dataDir = "./";
+  }
 
 
-/**
- * @brief standard constructor
-*/
-NewResourceManager::NewResourceManager ()
-{
-  this->registerObject(this, NewResourceManager::_objectList);
-  this->setName("NewResourceManager");
+  /**
+   * @brief standard destructor
+  */
+  NewResourceManager::~NewResourceManager ()
+  {
+    // deleting the Resources-List
+    //this->unloadAllByPriority(RP_GAME);
 
-  //this->dataDir = "./";
-}
+    //   if (!this->resourceList.empty())
+    //     PRINTF(1)("Not removed all Resources, since there are still %d resources registered\n", this->resourceList.size());
 
-
-/**
- * @brief standard destructor
-*/
-NewResourceManager::~NewResourceManager ()
-{
-  // deleting the Resources-List
-  //this->unloadAllByPriority(RP_GAME);
-
-  //   if (!this->resourceList.empty())
-  //     PRINTF(1)("Not removed all Resources, since there are still %d resources registered\n", this->resourceList.size());
-
-  NewResourceManager::_singletonRef = NULL;
-}
+    NewResourceManager::_singletonRef = NULL;
+  }
 
 
 
 
-void NewResourceManager::registerType(Resources::Type* type)
-{
-  if(type->id() == -1)
+  void NewResourceManager::registerType(Resources::Type* type)
   {
-    type->setID(this->_resourceTypes.size());
-    this->_resourceTypes.push_back(type);
-    PRINTF(5)("ResourceType '%s' with ID %d added\n", type->storedClassName().c_str(), type->id());
+    if(type->id() == -1)
+    {
+      type->setID(this->_resourceTypes.size());
+      this->_resourceTypes.push_back(type);
+      PRINTF(5)("ResourceType '%s' with ID %d added\n", type->storedClassName().c_str(), type->id());
+    }
   }
-}
 
-void NewResourceManager::unregisterType(Resources::Type* type)
-{
-  std::vector<Resources::Type*>::iterator it = std::find (this->_resourceTypes.begin(), this->_resourceTypes.end(), type);
-  if (it != this->_resourceTypes.end())
+  void NewResourceManager::unregisterType(Resources::Type* type)
   {
-    this->_resourceTypes.erase(it);
-    PRINTF(5)("ResourceType '%s' with ID %d removed\n", type->storedClassName().c_str(), type->id());
+    std::vector<Resources::Type*>::iterator it = std::find (this->_resourceTypes.begin(), this->_resourceTypes.end(), type);
+    if (it != this->_resourceTypes.end())
+    {
+      this->_resourceTypes.erase(it);
+      PRINTF(5)("ResourceType '%s' with ID %d removed\n", type->storedClassName().c_str(), type->id());
+    }
   }
-}
 
 
-void NewResourceManager::setMainGlobalPath(const Directory& directory)
-{
-  this->_mainGlobalPath = directory;
-  this->_mainGlobalPath.open();
-}
+  void NewResourceManager::setMainGlobalPath(const Directory& directory)
+  {
+    this->_mainGlobalPath = directory;
+    this->_mainGlobalPath.open();
+  }
 
-void NewResourceManager::addGlobalPath(const Directory& directory)
-{
-  std::vector<Directory>::const_iterator it = std::find(this->_globalPaths.begin(), this->_globalPaths.end(), directory);
-  if (it == this->_globalPaths.end())
-    this->_globalPaths.push_back(directory);
-}
+  void NewResourceManager::addGlobalPath(const Directory& directory)
+  {
+    std::vector<Directory>::const_iterator it = std::find(this->_globalPaths.begin(), this->_globalPaths.end(), directory);
+    if (it == this->_globalPaths.end())
+      this->_globalPaths.push_back(directory);
+  }
 
 
-bool NewResourceManager::addResourcePath(const std::string& resourceName, const std::string& pathName)
-{
-  std::vector<Resources::Type*>::iterator it;
-  for (it = this->_resourceTypes.begin(); it != this->_resourceTypes.end(); ++it)
-    if (*(*it) == resourceName)
-      return (*it)->addResourcePath(pathName);
-  PRINTF(2)("ResourcePath %s could not be added to the ResourceType %s\n", pathName.c_str(), resourceName.c_str());
-  return false;
-}
+  bool NewResourceManager::addResourcePath(const std::string& resourceName, const std::string& pathName)
+  {
+    std::vector<Resources::Type*>::iterator it;
+    for (it = this->_resourceTypes.begin(); it != this->_resourceTypes.end(); ++it)
+      if (*(*it) == resourceName)
+        return (*it)->addResourcePath(pathName);
+    PRINTF(2)("ResourcePath %s could not be added to the ResourceType %s\n", pathName.c_str(), resourceName.c_str());
+    return false;
+  }
 
-bool NewResourceManager::addResourceSubPath(const std::string& resourceName, const std::string& pathName)
-{
-  std::vector<Resources::Type*>::iterator it;
-  for (it = this->_resourceTypes.begin(); it != this->_resourceTypes.end(); ++it)
-    if (*(*it) == resourceName)
-      return (*it)->addResourceSubPath(pathName);
-  PRINTF(2)("ResourceSubPath %s could not be added to the ResourceType %s\n", pathName.c_str(), resourceName.c_str());
-  return false;
-}
+  bool NewResourceManager::addResourceSubPath(const std::string& resourceName, const std::string& pathName)
+  {
+    std::vector<Resources::Type*>::iterator it;
+    for (it = this->_resourceTypes.begin(); it != this->_resourceTypes.end(); ++it)
+      if (*(*it) == resourceName)
+        return (*it)->addResourceSubPath(pathName);
+    PRINTF(2)("ResourceSubPath %s could not be added to the ResourceType %s\n", pathName.c_str(), resourceName.c_str());
+    return false;
+  }
 
 
 
-bool NewResourceManager::checkFileInMainPath(const File& fileInside)
-{
-  return (this->_mainGlobalPath + fileInside).exists();
-}
+  bool NewResourceManager::checkFileInMainPath(const File& fileInside)
+  {
+    return (this->_mainGlobalPath + fileInside).exists();
+  }
 
 
 
-unsigned int NewResourceManager::addKeepLevelName(const std::string& keepLevelName)
-{
-  this->_keepLevelNames.push_back(keepLevelName);
-  return _keepLevelNames.size()-1;
-}
+  unsigned int NewResourceManager::addKeepLevelName(const std::string& keepLevelName)
+  {
+    this->_keepLevelNames.push_back(keepLevelName);
+    return _keepLevelNames.size()-1;
+  }
 
-unsigned int NewResourceManager::getKeepLevelID(const std::string& keepLevelName) const
-{
-  for (unsigned int i = 0; i < this->_keepLevelNames.size(); ++i)
-    if (this->_keepLevelNames[i] == keepLevelName)
-      return i;
+  unsigned int NewResourceManager::getKeepLevelID(const std::string& keepLevelName) const
+  {
+    for (unsigned int i = 0; i < this->_keepLevelNames.size(); ++i)
+      if (this->_keepLevelNames[i] == keepLevelName)
+        return i;
 
-  PRINTF(2)("KeepLevel '%s' not found. Using 0 instead\n", keepLevelName.c_str());
-  return 0;
-}
+    PRINTF(2)("KeepLevel '%s' not found. Using 0 instead\n", keepLevelName.c_str());
+    return 0;
+  }
 
-const std::string& NewResourceManager::getKeepLevelName(unsigned int keepLevelID) const
-{
-  assert(keepLevelID < this->_keepLevelNames.size());
-  return this->_keepLevelNames[keepLevelID];
-}
+  const std::string& NewResourceManager::getKeepLevelName(unsigned int keepLevelID) const
+  {
+    assert(keepLevelID < this->_keepLevelNames.size());
+    return this->_keepLevelNames[keepLevelID];
+  }
 
 
-/**
- * @brief outputs debug information about the NewResourceManager
- */
-void NewResourceManager::debug() const
-{
-  PRINT(0)("=RM===================================\n");
-  PRINT(0)("= RESOURCE-MANAGER DEBUG INFORMATION =\n");
-  PRINT(0)("======================================\n");
-  PRINT(0)(" MainGlobal search path is %s\n", this->_mainGlobalPath.name().c_str());
-  if(!this->_globalPaths.empty())
+  /**
+   * @brief outputs debug information about the NewResourceManager
+   */
+  void NewResourceManager::debug() const
   {
-    PRINT(0)(" Additional Global search Paths are: ");
-    for (unsigned int i = 0; i < this->_globalPaths.size(); ++i)
-      PRINT(0)("'%s' ", this->_globalPaths[i].name().c_str());
+    PRINT(0)("=RM===================================\n");
+    PRINT(0)("= RESOURCE-MANAGER DEBUG INFORMATION =\n");
+    PRINT(0)("======================================\n");
+    PRINT(0)(" MainGlobal search path is %s\n", this->_mainGlobalPath.name().c_str());
+    if(!this->_globalPaths.empty())
+    {
+      PRINT(0)(" Additional Global search Paths are: ");
+      for (unsigned int i = 0; i < this->_globalPaths.size(); ++i)
+        PRINT(0)("'%s' ", this->_globalPaths[i].name().c_str());
+      PRINT(0)("\n");
+    }
+    PRINT(0)(" Listing %d Types: \n", this->_resourceTypes.size());
+    std::vector<Resources::Type*>::const_iterator it;
+    for (it = this->_resourceTypes.begin(); it != this->_resourceTypes.end(); ++it)
+    {
+      (*it)->debug();
+      if (it != --this->_resourceTypes.end())
+        PRINT(0)(" ------------------------------------\n ");
+    }
+
+    PRINT(0)("KeepLevels are: ");
+    for (unsigned int i = 0; i < this->_keepLevelNames.size(); ++i)
+      PRINT(0)("%d:'%s'  ", i, this->_keepLevelNames[i].c_str());
     PRINT(0)("\n");
+    PRINT(0)("==================================RM==\n");
   }
-  PRINT(0)(" Listing %d Types: \n", this->_resourceTypes.size());
-  std::vector<Resources::Type*>::const_iterator it;
-  for (it = this->_resourceTypes.begin(); it != this->_resourceTypes.end(); ++it)
-  {
-    (*it)->debug();
-    if (it != --this->_resourceTypes.end())
-      PRINT(0)(" ------------------------------------\n ");
-  }
-
-  PRINT(0)("KeepLevels are: ");
-  for (unsigned int i = 0; i < this->_keepLevelNames.size(); ++i)
-    PRINT(0)("%d:'%s'  ", i, this->_keepLevelNames[i].c_str());
-  PRINT(0)("\n");
-  PRINT(0)("==================================RM==\n");
 }
