Index: trunk/src/lib/shell/Makefile.am
===================================================================
--- trunk/src/lib/shell/Makefile.am	(revision 5638)
+++ trunk/src/lib/shell/Makefile.am	(revision 5639)
@@ -8,4 +8,5 @@
 			shell_input.cc \
 		        shell_command.cc \
+		        shell_command_class.cc \
 			shell_completion.cc
 
@@ -15,3 +16,4 @@
 		shell_input.h \
                 shell_command.h \
+                shell_command_class.h \
 		shell_completion.h
Index: trunk/src/lib/shell/Makefile.in
===================================================================
--- trunk/src/lib/shell/Makefile.in	(revision 5638)
+++ trunk/src/lib/shell/Makefile.in	(revision 5639)
@@ -56,5 +56,5 @@
 am_libORXshell_a_OBJECTS = shell.$(OBJEXT) shell_buffer.$(OBJEXT) \
 	shell_input.$(OBJEXT) shell_command.$(OBJEXT) \
-	shell_completion.$(OBJEXT)
+	shell_command_class.$(OBJEXT) shell_completion.$(OBJEXT)
 libORXshell_a_OBJECTS = $(am_libORXshell_a_OBJECTS)
 DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
@@ -188,4 +188,5 @@
 			shell_input.cc \
 		        shell_command.cc \
+		        shell_command_class.cc \
 			shell_completion.cc
 
@@ -194,4 +195,5 @@
 		shell_input.h \
                 shell_command.h \
+                shell_command_class.h \
 		shell_completion.h
 
@@ -246,4 +248,5 @@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shell_buffer.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shell_command.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shell_command_class.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shell_completion.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shell_input.Po@am__quote@
Index: trunk/src/lib/shell/shell_command.cc
===================================================================
--- trunk/src/lib/shell/shell_command.cc	(revision 5638)
+++ trunk/src/lib/shell/shell_command.cc	(revision 5639)
@@ -17,4 +17,5 @@
 
 #include "shell_command.h"
+#include "shell_command_class.h"
 
 #include "list.h"
@@ -29,249 +30,4 @@
 using namespace std;
 
-/**
- * creates a new ShellCommandClass
- * @param className the Name of the command-class to create
- */
-ShellCommandClass::ShellCommandClass(const char* className)
-{
-  this->setClassID(CL_SHELL_COMMAND_CLASS, "ShellCommandClass");
-  this->setName(className);
-
-  this->className = className;
-  this->classID = CL_NULL;
-  this->commandList = new tList<ShellCommand>;
-
-  ShellCommandClass::commandClassList->add(this);
-}
-
-/**
- * destructs the shellCommandClass again
- */
-ShellCommandClass::~ShellCommandClass()
-{
-  tIterator<ShellCommand>* iterator = this->commandList->getIterator();
-  ShellCommand* elem = iterator->firstElement();
-  while(elem != NULL)
-  {
-    delete elem;
-    elem = iterator->nextElement();
-  }
-  delete iterator;
-  delete this->commandList;
-}
-
-/**
- * collects the Commands registered to some class.
- * @param className the name of the Class to collect the Commands from.
- * @param stringList a List to paste the Commands into.
- * @returns true on success, false otherwise
- */
-bool ShellCommandClass::getCommandListOfClass(const char* className, tList<const char>* stringList)
-{
-  if (stringList == NULL || className == NULL)
-    return false;
-
-  tIterator<ShellCommandClass>* iterator = ShellCommandClass::commandClassList->getIterator();
-  ShellCommandClass* elem = iterator->firstElement();
-  while(elem != NULL)
-  {
-    if (!strcmp (elem->getName(), className))
-    {
-      tIterator<ShellCommand>* itFkt = elem->commandList->getIterator();
-      ShellCommand* command = itFkt->firstElement();
-      while (command != NULL)
-      {
-        stringList->add(command->getName());
-        command = itFkt->nextElement();
-      }
-      delete itFkt;
-    }
-
-    elem = iterator->nextElement();
-  }
-  delete iterator;
-  return true;
-}
-
-/**
- * collects the Aliases registered to the ShellCommands
- * @param stringList a List to paste the Aliases into.
- * @returns true on success, false otherwise
- */
-bool ShellCommandClass::getCommandListOfAlias(tList<const char>* stringList)
-{
-  if (stringList == NULL || ShellCommandClass::aliasList == NULL)
-    return false;
-
-  tIterator<ShellCommandAlias>* iterator = ShellCommandClass::aliasList->getIterator();
-   ShellCommandAlias* elem = iterator->firstElement();
-   while(elem != NULL)
-   {
-     stringList->add(elem->getName());
-     elem = iterator->nextElement();
-   }
-   delete iterator;
-   return true;
-}
-
-/**
- * unregisters all Commands that exist
- */
-void ShellCommandClass::unregisterAllCommands()
-{
-  if (ShellCommandClass::commandClassList != NULL)
-  {
-    // unregister all commands
-    tIterator<ShellCommandClass>* iterator = ShellCommandClass::commandClassList->getIterator();
-    ShellCommandClass* elem = iterator->firstElement();
-    while(elem != NULL)
-    {
-      delete elem;
-
-      elem = iterator->nextElement();
-    }
-    delete iterator;
-
-    delete ShellCommandClass::commandClassList;
-    ShellCommandClass::commandClassList = NULL;
-  }
-
-  // unregister all aliases (there should be nothing to do here :))
-  if (ShellCommandClass::aliasList != NULL)
-  {
-    tIterator<ShellCommandAlias>* itAL = ShellCommandClass::aliasList->getIterator();
-    ShellCommandAlias* elemAL = itAL->firstElement();
-    while(elemAL != NULL)
-    {
-      delete elemAL;
-      elemAL = itAL->nextElement();
-    }
-    delete itAL;
-    delete ShellCommandClass::aliasList;
-    ShellCommandClass::aliasList = NULL;
-  }
-}
-
-/**
- * checks if a Class is already registered to the Commands' class-stack
- * @param className the Name of the Class to check for
- * @returns the CommandClass if found, NULL otherwise
- */
-const ShellCommandClass* ShellCommandClass::isRegistered(const char* className)
-{
-  if (ShellCommandClass::commandClassList == NULL)
-    initCommandClassList();
-
-  tIterator<ShellCommandClass>* iterator = ShellCommandClass::commandClassList->getIterator();
-  ShellCommandClass* elem = iterator->firstElement();
-  while(elem != NULL)
-  {
-    if (!strcmp(className, elem->className))
-    {
-      if (elem->classID == CL_NULL)
-        elem->classID = ClassList::StringToID(className);
-
-      delete iterator;
-      return elem;
-    }
-    elem = iterator->nextElement();
-  }
-  delete iterator;
-  return NULL;
-}
-
-/**
- * searches for a CommandClass
- * @param className the name of the CommandClass
- * @returns the CommandClass if found, or a new CommandClass if not
- */
-ShellCommandClass* ShellCommandClass::getCommandClass(const char* className)
-{
-  if (ShellCommandClass::commandClassList == NULL)
-    initCommandClassList();
-
-  tIterator<ShellCommandClass>* iterator = ShellCommandClass::commandClassList->getIterator();
-  ShellCommandClass* elem = iterator->firstElement();
-  while(elem != NULL)
-  {
-    if (!strcmp(className, elem->className))
-    {
-      delete iterator;
-      return elem;
-    }
-    elem = iterator->nextElement();
-  }
-  delete iterator;
-  return new ShellCommandClass(className);
-}
-
-/**
- * initializes the CommandList (if it is NULL)
- */
-void ShellCommandClass::initCommandClassList()
-{
-  if (ShellCommandClass::commandClassList == NULL)
-  {
-    ShellCommandClass::commandClassList = new tList<ShellCommandClass>;
-    ShellCommand::registerCommand("debug", "ShellCommand", new ExecutorStatic<ShellCommand>(ShellCommand::debug));
-  }
-}
-
-void ShellCommandClass::help(const char* className)
-{
-  if (className == NULL)
-    return;
-  if (likely(ShellCommandClass::commandClassList != NULL))
-  {
-    tIterator<ShellCommandClass>* itCL = ShellCommandClass::commandClassList->getIterator();
-    ShellCommandClass* elemCL = itCL->firstElement();
-    while(elemCL != NULL)
-    {
-      if (elemCL->className && !strcasecmp(className, elemCL->className))
-      {
-        PRINT(0)("Class:'%s' registered %d commands: \n", elemCL->className, elemCL->commandList->getSize());
-        tIterator<ShellCommand>* iterator = elemCL->commandList->getIterator();
-        const ShellCommand* elem = iterator->firstElement();
-        while(elem != NULL)
-        {
-          PRINT(0)("  command:'%s' : params:%d: ", elem->getName(), elem->paramCount);
-          for (unsigned int i = 0; i< elem->paramCount; i++)
-            PRINT(0)("%s ", ShellCommand::paramToString(elem->parameters[i]));
-          if (elem->description != NULL)
-            PRINT(0)("- %s", elem->description);
-          PRINT(0)("\n");
-          elem = iterator->nextElement();
-        }
-        delete iterator;
-
-        delete itCL;
-        return;
-      }
-      elemCL = itCL->nextElement();
-    }
-    delete itCL;
-    PRINTF(3)("Class %s not found in Command's classes\n", className);
-  }
-  else
-  {
-    PRINTF(1)("List of commandClasses does not exist");
-  }
-}
-
-tList<ShellCommandClass>* ShellCommandClass::commandClassList = NULL;
-tList<ShellCommandAlias>* ShellCommandClass::aliasList = NULL;
-
-
-
-
-
-
-
-
-
-
-////////////////////////
-// SHELL COMMAND BASE //
-////////////////////////
 /**
  * constructs and registers a new Command
Index: trunk/src/lib/shell/shell_command.h
===================================================================
--- trunk/src/lib/shell/shell_command.h	(revision 5638)
+++ trunk/src/lib/shell/shell_command.h	(revision 5639)
@@ -22,4 +22,6 @@
 // FORWARD DECLARATION
 template<class T> class tList;
+class ShellCommandClass;
+class ShellCommandAlias;
 
 /**
@@ -63,42 +65,4 @@
   ShellCommand_Static    = 2,
 } ShellCommand_Type;
-
-////////////////
-// BASE CLASS //
-////////////////
-class ShellCommand;
-class ShellCommandAlias;
-
-//! A class to hold all Classes that have (once) registered Commands.
-class ShellCommandClass : public BaseObject
-{
-  friend class ShellCommand;
-
-  public:
-    /** @returns the CommandClassList */
-    static const tList<ShellCommandClass>* getCommandClassList() { return ShellCommandClass::commandClassList; };
-    static bool getCommandListOfClass(const char* className, tList<const char>* stringList);
-    static bool getCommandListOfAlias(tList<const char>* aliasList);
-
-    static ShellCommandClass* getCommandClass(const char* className);
-    static void unregisterAllCommands();
-
-    static void help (const char* className);
-
-  private:
-    ShellCommandClass(const char* className);
-    ~ShellCommandClass();
-
-    static const ShellCommandClass* isRegistered(const char* className);
-    static void initCommandClassList();
-
-  private:
-    const char*                      className;                 //!< The Name of the Class. This should match the ClassName of the Commands Class.
-    long                             classID;                   //!< The classID of this Class
-    tList<ShellCommand>*         commandList;               //!< A list of Commands from this Class
-    static tList<ShellCommandClass>* commandClassList;          //!< A list of Classes
-    static tList<ShellCommandAlias>* aliasList;                 //!< An Alias to A Command. (only for classes with one Instance)
-};
-
 
 //! a baseClass for all possible ShellCommands
Index: trunk/src/lib/shell/shell_command_class.cc
===================================================================
--- trunk/src/lib/shell/shell_command_class.cc	(revision 5639)
+++ trunk/src/lib/shell/shell_command_class.cc	(revision 5639)
@@ -0,0 +1,263 @@
+/*
+   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: Benjamin Grauer
+   co-programmer: ...
+*/
+
+//#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_
+
+#include "shell_command_class.h"
+
+#include "shell_command.h"
+
+#include "list.h"
+#include "debug.h"
+#include "class_list.h"
+
+#include <stdio.h>
+#include <string.h>
+
+using namespace std;
+
+tList<ShellCommandClass>* ShellCommandClass::commandClassList = NULL;
+tList<ShellCommandAlias>* ShellCommandClass::aliasList = NULL;
+
+/**
+ * creates a new ShellCommandClass
+ * @param className the Name of the command-class to create
+ */
+ShellCommandClass::ShellCommandClass(const char* className)
+{
+  this->setClassID(CL_SHELL_COMMAND_CLASS, "ShellCommandClass");
+  this->setName(className);
+
+  this->className = className;
+  this->classID = CL_NULL;
+  this->commandList = new tList<ShellCommand>;
+
+  ShellCommandClass::commandClassList->add(this);
+}
+
+/**
+ * destructs the shellCommandClass again
+ */
+ShellCommandClass::~ShellCommandClass()
+{
+  tIterator<ShellCommand>* iterator = this->commandList->getIterator();
+  ShellCommand* elem = iterator->firstElement();
+  while(elem != NULL)
+  {
+    delete elem;
+    elem = iterator->nextElement();
+  }
+  delete iterator;
+  delete this->commandList;
+}
+
+/**
+ * collects the Commands registered to some class.
+ * @param className the name of the Class to collect the Commands from.
+ * @param stringList a List to paste the Commands into.
+ * @returns true on success, false otherwise
+ */
+bool ShellCommandClass::getCommandListOfClass(const char* className, tList<const char>* stringList)
+{
+  if (stringList == NULL || className == NULL)
+    return false;
+
+  tIterator<ShellCommandClass>* iterator = ShellCommandClass::commandClassList->getIterator();
+  ShellCommandClass* elem = iterator->firstElement();
+  while(elem != NULL)
+  {
+    if (!strcmp (elem->getName(), className))
+    {
+      tIterator<ShellCommand>* itFkt = elem->commandList->getIterator();
+      ShellCommand* command = itFkt->firstElement();
+      while (command != NULL)
+      {
+        stringList->add(command->getName());
+        command = itFkt->nextElement();
+      }
+      delete itFkt;
+    }
+
+    elem = iterator->nextElement();
+  }
+  delete iterator;
+  return true;
+}
+
+/**
+ * collects the Aliases registered to the ShellCommands
+ * @param stringList a List to paste the Aliases into.
+ * @returns true on success, false otherwise
+ */
+bool ShellCommandClass::getCommandListOfAlias(tList<const char>* stringList)
+{
+  if (stringList == NULL || ShellCommandClass::aliasList == NULL)
+    return false;
+
+  tIterator<ShellCommandAlias>* iterator = ShellCommandClass::aliasList->getIterator();
+   ShellCommandAlias* elem = iterator->firstElement();
+   while(elem != NULL)
+   {
+     stringList->add(elem->getName());
+     elem = iterator->nextElement();
+   }
+   delete iterator;
+   return true;
+}
+
+/**
+ * unregisters all Commands that exist
+ */
+void ShellCommandClass::unregisterAllCommands()
+{
+  if (ShellCommandClass::commandClassList != NULL)
+  {
+    // unregister all commands
+    tIterator<ShellCommandClass>* iterator = ShellCommandClass::commandClassList->getIterator();
+    ShellCommandClass* elem = iterator->firstElement();
+    while(elem != NULL)
+    {
+      delete elem;
+
+      elem = iterator->nextElement();
+    }
+    delete iterator;
+
+    delete ShellCommandClass::commandClassList;
+    ShellCommandClass::commandClassList = NULL;
+  }
+
+  // unregister all aliases (there should be nothing to do here :))
+  if (ShellCommandClass::aliasList != NULL)
+  {
+    tIterator<ShellCommandAlias>* itAL = ShellCommandClass::aliasList->getIterator();
+    ShellCommandAlias* elemAL = itAL->firstElement();
+    while(elemAL != NULL)
+    {
+      delete elemAL;
+      elemAL = itAL->nextElement();
+    }
+    delete itAL;
+    delete ShellCommandClass::aliasList;
+    ShellCommandClass::aliasList = NULL;
+  }
+}
+
+/**
+ * checks if a Class is already registered to the Commands' class-stack
+ * @param className the Name of the Class to check for
+ * @returns the CommandClass if found, NULL otherwise
+ */
+const ShellCommandClass* ShellCommandClass::isRegistered(const char* className)
+{
+  if (ShellCommandClass::commandClassList == NULL)
+    initCommandClassList();
+
+  tIterator<ShellCommandClass>* iterator = ShellCommandClass::commandClassList->getIterator();
+  ShellCommandClass* elem = iterator->firstElement();
+  while(elem != NULL)
+  {
+    if (!strcmp(className, elem->className))
+    {
+      if (elem->classID == CL_NULL)
+        elem->classID = ClassList::StringToID(className);
+
+      delete iterator;
+      return elem;
+    }
+    elem = iterator->nextElement();
+  }
+  delete iterator;
+  return NULL;
+}
+
+/**
+ * searches for a CommandClass
+ * @param className the name of the CommandClass
+ * @returns the CommandClass if found, or a new CommandClass if not
+ */
+ShellCommandClass* ShellCommandClass::getCommandClass(const char* className)
+{
+  if (ShellCommandClass::commandClassList == NULL)
+    initCommandClassList();
+
+  tIterator<ShellCommandClass>* iterator = ShellCommandClass::commandClassList->getIterator();
+  ShellCommandClass* elem = iterator->firstElement();
+  while(elem != NULL)
+  {
+    if (!strcmp(className, elem->className))
+    {
+      delete iterator;
+      return elem;
+    }
+    elem = iterator->nextElement();
+  }
+  delete iterator;
+  return new ShellCommandClass(className);
+}
+
+/**
+ * initializes the CommandList (if it is NULL)
+ */
+void ShellCommandClass::initCommandClassList()
+{
+  if (ShellCommandClass::commandClassList == NULL)
+  {
+    ShellCommandClass::commandClassList = new tList<ShellCommandClass>;
+    ShellCommand::registerCommand("debug", "ShellCommand", new ExecutorStatic<ShellCommand>(ShellCommand::debug));
+  }
+}
+
+void ShellCommandClass::help(const char* className)
+{
+  if (className == NULL)
+    return;
+  if (likely(ShellCommandClass::commandClassList != NULL))
+  {
+    tIterator<ShellCommandClass>* itCL = ShellCommandClass::commandClassList->getIterator();
+    ShellCommandClass* elemCL = itCL->firstElement();
+    while(elemCL != NULL)
+    {
+      if (elemCL->className && !strcasecmp(className, elemCL->className))
+      {
+        PRINT(0)("Class:'%s' registered %d commands: \n", elemCL->className, elemCL->commandList->getSize());
+        tIterator<ShellCommand>* iterator = elemCL->commandList->getIterator();
+        const ShellCommand* elem = iterator->firstElement();
+        while(elem != NULL)
+        {
+          PRINT(0)("  command:'%s' : params:%d: ", elem->getName(), elem->paramCount);
+          for (unsigned int i = 0; i< elem->paramCount; i++)
+            PRINT(0)("%s ", ShellCommand::paramToString(elem->parameters[i]));
+          if (elem->description != NULL)
+            PRINT(0)("- %s", elem->description);
+          PRINT(0)("\n");
+          elem = iterator->nextElement();
+        }
+        delete iterator;
+
+        delete itCL;
+        return;
+      }
+      elemCL = itCL->nextElement();
+    }
+    delete itCL;
+    PRINTF(3)("Class %s not found in Command's classes\n", className);
+  }
+  else
+  {
+    PRINTF(1)("List of commandClasses does not exist");
+  }
+}
+
Index: trunk/src/lib/shell/shell_command_class.h
===================================================================
--- trunk/src/lib/shell/shell_command_class.h	(revision 5639)
+++ trunk/src/lib/shell/shell_command_class.h	(revision 5639)
@@ -0,0 +1,52 @@
+/*!
+ * @file shell_command_class.h
+ * Definition of a on-screen-shell
+ */
+
+#ifndef _SHELL_COMMAND_CLASS_H
+#define _SHELL_COMMAND_CLASS_H
+
+#include "base_object.h"
+
+
+// FORWARD DECLARATION
+template<class T> class tList;
+
+////////////////
+// BASE CLASS //
+////////////////
+class ShellCommand;
+class ShellCommandAlias;
+
+//! A class to hold all Classes that have (once) registered Commands.
+class ShellCommandClass : public BaseObject
+{
+  friend class ShellCommand;
+
+  public:
+    /** @returns the CommandClassList */
+    static const tList<ShellCommandClass>* getCommandClassList() { return ShellCommandClass::commandClassList; };
+    static bool getCommandListOfClass(const char* className, tList<const char>* stringList);
+    static bool getCommandListOfAlias(tList<const char>* aliasList);
+
+    static ShellCommandClass* getCommandClass(const char* className);
+    static void unregisterAllCommands();
+
+    static void help (const char* className);
+
+  private:
+    ShellCommandClass(const char* className);
+    ~ShellCommandClass();
+
+    static const ShellCommandClass* isRegistered(const char* className);
+    static void initCommandClassList();
+
+  private:
+    const char*                      className;                 //!< The Name of the Class. This should match the ClassName of the Commands Class.
+    long                             classID;                   //!< The classID of this Class
+    tList<ShellCommand>*             commandList;               //!< A list of Commands from this Class
+    static tList<ShellCommandClass>* commandClassList;          //!< A list of Classes
+    static tList<ShellCommandAlias>* aliasList;                 //!< An Alias to A Command. (only for classes with one Instance)
+};
+
+#endif /* _SHELL_COMMAND_H */
Index: trunk/src/lib/shell/shell_completion.cc
===================================================================
--- trunk/src/lib/shell/shell_completion.cc	(revision 5638)
+++ trunk/src/lib/shell/shell_completion.cc	(revision 5639)
@@ -17,4 +17,5 @@
 
 #include "shell_completion.h"
+#include "shell_command_class.h"
 
 #include "shell_input.h"
Index: trunk/src/lib/shell/shell_input.cc
===================================================================
--- trunk/src/lib/shell/shell_input.cc	(revision 5638)
+++ trunk/src/lib/shell/shell_input.cc	(revision 5639)
@@ -21,4 +21,5 @@
 
 #include "shell_command.h"
+#include "shell_command_class.h"
 #include "shell_completion.h"
 #include "event_handler.h"
