Index: code/branches/main_reto_vs05/src/class_hierarchy/BaseObject.cc
===================================================================
--- code/branches/main_reto_vs05/src/class_hierarchy/BaseObject.cc	(revision 232)
+++ code/branches/main_reto_vs05/src/class_hierarchy/BaseObject.cc	(revision 232)
@@ -0,0 +1,14 @@
+#include "BaseObject.h"
+
+namespace orxonox
+{
+    BaseObject::BaseObject()
+    {
+        registerRootObject(BaseObject);
+    }
+
+    BaseObject::~BaseObject()
+    {
+        unregisterObject();
+    }
+}
Index: code/branches/main_reto_vs05/src/class_hierarchy/BaseObject.h
===================================================================
--- code/branches/main_reto_vs05/src/class_hierarchy/BaseObject.h	(revision 232)
+++ code/branches/main_reto_vs05/src/class_hierarchy/BaseObject.h	(revision 232)
@@ -0,0 +1,70 @@
+#ifndef _BaseObject_H__
+#define _BaseObject_H__
+
+#include "IdentifierIncludes.h"
+
+namespace orxonox
+{
+    class BaseObject : virtual public OrxonoxClass
+    {
+        public:
+            BaseObject();
+            virtual ~BaseObject();
+
+            inline bool isA(Identifier* identifier)
+                { return this->getIdentifier()->isA(identifier); }
+            inline bool isDirectlyA(Identifier* identifier)
+                { return this->getIdentifier()->isDirectlyA(identifier); }
+            inline bool isChildOf(Identifier* identifier)
+                { return this->getIdentifier()->isChildOf(identifier); }
+            inline bool isDirectChildOf(Identifier* identifier)
+                { return this->getIdentifier()->isDirectChildOf(identifier); }
+            inline bool isParentOf(Identifier* identifier)
+                { return this->getIdentifier()->isParentOf(identifier); }
+            inline bool isDirectParentOf(Identifier* identifier)
+                { return this->getIdentifier()->isDirectParentOf(identifier); }
+
+            inline bool isA(BaseIdentifier<class B>* identifier)
+                { return this->getIdentifier()->isA(identifier->getIdentifier()); }
+            inline bool isDirectlyA(BaseIdentifier<class B>* identifier)
+                { return this->getIdentifier()->isDirectlyA(identifier->getIdentifier()); }
+            inline bool isChildOf(BaseIdentifier<class B>* identifier)
+                { return this->getIdentifier()->isChildOf(identifier->getIdentifier()); }
+            inline bool isDirectChildOf(BaseIdentifier<class B>* identifier)
+                { return this->getIdentifier()->isDirectChildOf(identifier->getIdentifier()); }
+            inline bool isParentOf(BaseIdentifier<class B>* identifier)
+                { return this->getIdentifier()->isParentOf(identifier->getIdentifier()); }
+            inline bool isDirectParentOf(BaseIdentifier<class B>* identifier)
+                { return this->getIdentifier()->isDirectParentOf(identifier->getIdentifier()); }
+
+            inline bool isA(BaseIdentifier<class B> identifier)
+                { return this->getIdentifier()->isA(identifier.getIdentifier()); }
+            inline bool isDirectlyA(BaseIdentifier<class B> identifier)
+                { return this->getIdentifier()->isDirectlyA(identifier.getIdentifier()); }
+            inline bool isChildOf(BaseIdentifier<class B> identifier)
+                { return this->getIdentifier()->isChildOf(identifier.getIdentifier()); }
+            inline bool isDirectChildOf(BaseIdentifier<class B> identifier)
+                { return this->getIdentifier()->isDirectChildOf(identifier.getIdentifier()); }
+            inline bool isParentOf(BaseIdentifier<class B> identifier)
+                { return this->getIdentifier()->isParentOf(identifier.getIdentifier()); }
+            inline bool isDirectParentOf(BaseIdentifier<class B> identifier)
+                { return this->getIdentifier()->isDirectParentOf(identifier.getIdentifier()); }
+/*
+            inline bool isA(OrxonoxClass* object)
+                { return this->getIdentifier()->isA(object->getIdentifier()); }
+            inline bool isDirectlyA(OrxonoxClass* object)
+                { return this->getIdentifier()->isDirectlyA(object->getIdentifier); }
+            inline bool isChildOf(OrxonoxClass* object)
+                { return this->getIdentifier()->isChildOf(object->getIdentifier); }
+            inline bool isDirectChildOf(OrxonoxClass* object)
+                { return this->getIdentifier()->isDirectChildOf(object->getIdentifier); }
+            inline bool isParentOf(OrxonoxClass* object)
+                { return this->getIdentifier()->isParentOf(object->getIdentifier); }
+            inline bool isDirectParentOf(OrxonoxClass* object)
+                { return this->getIdentifier()->isDirectParentOf(object->getIdentifier); }
+*/
+
+    };
+}
+
+#endif
Index: code/branches/main_reto_vs05/src/class_hierarchy/ClassHierarchy.cc
===================================================================
--- code/branches/main_reto_vs05/src/class_hierarchy/ClassHierarchy.cc	(revision 232)
+++ code/branches/main_reto_vs05/src/class_hierarchy/ClassHierarchy.cc	(revision 232)
@@ -0,0 +1,28 @@
+#include "ClassHierarchy.h"
+#include "OrxonoxClass.h"
+
+namespace orxonox
+{
+    // ###############################
+    // ###     ClassHierarchy      ###
+    // ###############################
+    ClassHierarchy* ClassHierarchy::pointer_ = NULL;
+
+    ClassHierarchy* ClassHierarchy::getSingleton()
+    {
+        if (!pointer_)
+            pointer_ = new ClassHierarchy();
+
+        return pointer_;
+    }
+
+    ClassHierarchy::ClassHierarchy()
+    {
+        this->hierarchyCreatingCounter_ = 0;
+    }
+
+    ClassHierarchy::~ClassHierarchy()
+    {
+      this->pointer_ = NULL;
+    }
+}
Index: code/branches/main_reto_vs05/src/class_hierarchy/ClassHierarchy.h
===================================================================
--- code/branches/main_reto_vs05/src/class_hierarchy/ClassHierarchy.h	(revision 232)
+++ code/branches/main_reto_vs05/src/class_hierarchy/ClassHierarchy.h	(revision 232)
@@ -0,0 +1,97 @@
+#ifndef _ClassHierarchy_H__
+#define _ClassHierarchy_H__
+
+#include <string>
+#include <iostream>
+
+// DONE AND TESTED:
+// - build class hierarchy
+// - isA, isChildOf, ...
+// - insert into class-lists
+// - ClassIdentifier
+// - BaseIdentifier
+
+// IN WORK:
+// - Factory
+
+// TO DO:
+// - iterate through lists
+// - searchtree for classname-strings
+
+
+namespace orxonox
+{
+    // ##### ClassHierarchy #####
+    template <class T>
+    class ClassIdentifier;
+
+    class ClassHierarchy
+    {
+        template <class T>
+        friend class ClassIdentifier;
+
+        public:
+            static ClassHierarchy* getSingleton();
+            bool isCreatingHierarchy() { return (this->hierarchyCreatingCounter_ > 0); }
+
+        private:
+            ClassHierarchy();
+            ~ClassHierarchy();
+            void startCreatingHierarchy() { this->hierarchyCreatingCounter_++; std::cout << "*** Increased Hierarchy-Creating-Counter to " << this->hierarchyCreatingCounter_ << "\n"; }
+            void stopCreatingHierarchy() { this->hierarchyCreatingCounter_--; std::cout << "*** Decreased Hierarchy-Creating-Counter to " << this->hierarchyCreatingCounter_ << "\n"; }
+
+            static ClassHierarchy* pointer_;
+            int hierarchyCreatingCounter_;
+    };
+
+
+    // ##### Macros #####
+    #define registerRootObject(ClassName) \
+        std::cout << "*** Register Root-Object: " << #ClassName << "\n"; \
+        if (ClassHierarchy::getSingleton()->isCreatingHierarchy() && !this->getParents()) \
+            this->setParents(new IdentifierList()); \
+        if (this->getIdentifier()) \
+            this->getIdentifier()->removeObject(this); \
+        this->setIdentifier(ClassIdentifier<ClassName>::registerClass(this->getParents(), #ClassName, true, false)); \
+        if (ClassHierarchy::getSingleton()->isCreatingHierarchy() && this->getParents()) \
+            this->getParents()->add(this->getIdentifier()); \
+        this->getIdentifier()->addObject(this)
+
+    #define registerAbstractRootObject(ClassName) \
+        std::cout << "*** Register Root-Object: " << #ClassName << "\n"; \
+        if (ClassHierarchy::getSingleton()->isCreatingHierarchy() && !this->getParents()) \
+            this->setParents(new IdentifierList()); \
+        if (this->getIdentifier()) \
+            this->getIdentifier()->removeObject(this); \
+        this->setIdentifier(ClassIdentifier<ClassName>::registerClass(this->getParents(), #ClassName, true, true)); \
+        if (ClassHierarchy::getSingleton()->isCreatingHierarchy() && this->getParents()) \
+            this->getParents()->add(this->getIdentifier()); \
+        this->getIdentifier()->addObject(this)
+
+    #define registerObject(ClassName) \
+        std::cout << "*** Register Object: " << #ClassName << "\n"; \
+        this->getIdentifier()->removeObject(this); \
+        this->setIdentifier(ClassIdentifier<ClassName>::registerClass(this->getParents(), #ClassName, false, false)); \
+        if (ClassHierarchy::getSingleton()->isCreatingHierarchy() && this->getParents()) \
+            this->getParents()->add(this->getIdentifier()); \
+        this->getIdentifier()->addObject(this)
+
+    #define registerAbstractObject(ClassName) \
+        std::cout << "*** Register Object: " << #ClassName << "\n"; \
+        this->getIdentifier()->removeObject(this); \
+        this->setIdentifier(ClassIdentifier<ClassName>::registerClass(this->getParents(), #ClassName, false, true)); \
+        if (ClassHierarchy::getSingleton()->isCreatingHierarchy() && this->getParents()) \
+            this->getParents()->add(this->getIdentifier()); \
+        this->getIdentifier()->addObject(this)
+
+    #define unregisterObject() \
+        this->getIdentifier()->removeObject(this)
+
+    #define Class(ClassName) \
+        ClassIdentifier<ClassName>::getIdentifier()
+
+    #define Factory(ClassName) \
+        ClassIdentifier<ClassName>::create()
+}
+
+#endif
Index: code/branches/main_reto_vs05/src/class_hierarchy/Identifier.cc
===================================================================
--- code/branches/main_reto_vs05/src/class_hierarchy/Identifier.cc	(revision 232)
+++ code/branches/main_reto_vs05/src/class_hierarchy/Identifier.cc	(revision 232)
@@ -0,0 +1,117 @@
+#include "Identifier.h"
+
+namespace orxonox
+{
+    // ###############################
+    // ###       Identifier        ###
+    // ###############################
+    Identifier::Identifier()
+    {
+        this->bCreatedOneObject_ = false;
+        this->directParents_ = new IdentifierList();
+        this->allParents_ = new IdentifierList();
+        this->directChildren_ = new IdentifierList();
+        this->allChildren_ = new IdentifierList();
+        this->objects_ = new ObjectList();
+    }
+
+    Identifier::~Identifier()
+    {
+        delete this->directParents_;
+        delete this->allParents_;
+        delete this->directChildren_;
+        delete this->allChildren_;
+        delete this->objects_;
+        delete &this->name_;
+    }
+
+    void Identifier::initialize(IdentifierList* parents)
+    {
+        std::cout << "*** Initialize " << this->name_ << "-Singleton.\n";
+        if (parents)
+        {
+            this->bCreatedOneObject_ = true;
+
+            IdentifierListElement* temp1;
+            IdentifierListElement* temp2;
+            IdentifierListElement* temp3;
+
+            temp1 = parents->first_;
+            while (temp1)
+            {
+                temp2 = temp1->identifier_->directParents_->first_;
+                while (temp2)
+                {
+                    temp3 = parents->first_;
+                    while(temp3)
+                    {
+                        if (temp3->identifier_ == temp2->identifier_)
+                            temp3->bDirect_ = false;
+
+                        temp3 = temp3->next_;
+                    }
+
+                    temp2 = temp2->next_;
+                }
+                temp1 = temp1->next_;
+            }
+
+            temp1 = parents->first_;
+            while (temp1)
+            {
+                if (temp1->bDirect_)
+                {
+                    this->directParents_->add(temp1->identifier_);
+                    temp1->identifier_->directChildren_->add(this);
+                }
+
+                this->allParents_->add(temp1->identifier_);
+                temp1->identifier_->allChildren_->add(this);
+
+                temp1 = temp1->next_;
+            }
+        }
+    }
+
+    void Identifier::addObject(OrxonoxClass* object)
+    {
+        std::cout << "*** Added " << this->name_ << " to list.\n";
+        this->objects_->add(object);
+    }
+
+    void Identifier::removeObject(OrxonoxClass* object)
+    {
+        std::cout << "*** Removed " << this->name_ << " from list.\n";
+        this->objects_->remove(object);
+    }
+
+    bool Identifier::isA(Identifier* identifier)
+    {
+        return (identifier == this || this->allParents_->isInList(identifier));
+    }
+
+    bool Identifier::isDirectlyA(Identifier* identifier)
+    {
+        return (identifier == this);
+    }
+
+    bool Identifier::isChildOf(Identifier* identifier)
+    {
+        return this->allParents_->isInList(identifier);
+    }
+
+    bool Identifier::isDirectChildOf(Identifier* identifier)
+    {
+        return this->directParents_->isInList(identifier);
+    }
+
+    bool Identifier::isParentOf(Identifier* identifier)
+    {
+        return this->allChildren_->isInList(identifier);
+    }
+
+    bool Identifier::isDirectParentOf(Identifier* identifier)
+    {
+        return this->directChildren_->isInList(identifier);
+    }
+}
Index: code/branches/main_reto_vs05/src/class_hierarchy/Identifier.h
===================================================================
--- code/branches/main_reto_vs05/src/class_hierarchy/Identifier.h	(revision 232)
+++ code/branches/main_reto_vs05/src/class_hierarchy/Identifier.h	(revision 232)
@@ -0,0 +1,173 @@
+#ifndef _Identifier_H__
+#define _Identifier_H__
+
+#include "ClassHierarchy.h"
+#include "IdentifierList.h"
+#include "ObjectList.h"
+#include "OrxonoxClass.h"
+
+namespace orxonox
+{
+    // ##### Identifier #####
+    class Identifier
+    {
+        template <class T>
+        friend class ClassIdentifier;
+
+        template <class T>
+        friend class BaseIdentifier;
+
+        public:
+            void addObject(OrxonoxClass* object);
+            void removeObject(OrxonoxClass* object);
+
+            bool isA(Identifier* identifier);
+            bool isDirectlyA(Identifier* identifier);
+            bool isChildOf(Identifier* identifier);
+            bool isDirectChildOf(Identifier* identifier);
+            bool isParentOf(Identifier* identifier);
+            bool isDirectParentOf(Identifier* identifier);
+
+            std::string getName() { return this->name_; }
+            IdentifierList* getDirectParents() { return this->directParents_; }
+            IdentifierList* getAllParents() { return this->allParents_; }
+            IdentifierList* getDirectChildren() { return this->directChildren_; }
+            IdentifierList* getAllChildren() { return this->allChildren_; }
+
+        private:
+            Identifier();
+            Identifier(const Identifier& identifier) {}
+            virtual ~Identifier();
+            void initialize(IdentifierList* parents);
+
+            IdentifierList* directParents_;
+            IdentifierList* allParents_;
+            IdentifierList* directChildren_;
+            IdentifierList* allChildren_;
+
+            ObjectList* objects_;
+            std::string name_;
+
+            bool bIsAbstractClass_;
+            bool bCreatedOneObject_;
+    };
+
+
+    // ##### ClassIdentifier #####
+    template <class T>
+    class ClassIdentifier : public Identifier
+    {
+        public:
+            static ClassIdentifier<T>* registerClass(IdentifierList* parents, std::string name, bool bRootClass, bool bIsAbstractClass);
+            static ClassIdentifier<T>* getIdentifier();
+
+        private:
+            ClassIdentifier();
+            ClassIdentifier(const ClassIdentifier<T>& identifier) {}
+            ~ClassIdentifier();
+
+            static ClassIdentifier<T>* pointer_;
+
+    };
+
+    template <class T>
+    ClassIdentifier<T>* ClassIdentifier<T>::pointer_ = NULL;
+
+    template <class T>
+    ClassIdentifier<T>::ClassIdentifier()
+    {
+    }
+
+    template <class T>
+    ClassIdentifier<T>::~ClassIdentifier()
+    {
+        this->pointer_ = NULL;
+    }
+
+    template <class T>
+    ClassIdentifier<T>* ClassIdentifier<T>::registerClass(IdentifierList* parents, std::string name, bool bRootClass, bool bIsAbstractClass)
+    {
+        std::cout << "*** Register Class in " << name << "-Singleton.\n";
+        if (!pointer_)
+        {
+            std::cout << "*** Register Class in " << name << "-Singleton -> Create Singleton.\n";
+            if (parents || bRootClass)
+            {
+                pointer_ = new ClassIdentifier();
+                pointer_->name_ = name;
+                pointer_->bIsAbstractClass_ = bIsAbstractClass;
+                pointer_->initialize(parents);
+            }
+            else
+            {
+                pointer_ = getIdentifier();
+            }
+        }
+
+        return pointer_;
+    }
+
+    template <class T>
+    ClassIdentifier<T>* ClassIdentifier<T>::getIdentifier()
+    {
+//        std::cout << "*** Get Identifier.\n";
+        if (!pointer_)
+        {
+            std::cout << "*** Get Identifier -> Create Class\n";
+            ClassHierarchy::getSingleton()->startCreatingHierarchy();
+            T* temp = new T();
+            ClassHierarchy::getSingleton()->stopCreatingHierarchy();
+            delete temp;
+        }
+
+        return pointer_;
+    }
+
+
+    // ##### BaseIdentifier #####
+    template <class B>
+    class BaseIdentifier// : public Identifier
+    {
+        public:
+            BaseIdentifier();
+
+            //template <class T>
+            BaseIdentifier<B>& operator= (/*Class*/Identifier/*<T>*/* identifier)
+            {
+                if (!identifier->isA(ClassIdentifier<B>::getIdentifier()))
+                {
+                    std::cout << "Error: Class " << identifier->getName() << " is not a " << ClassIdentifier<B>::getIdentifier()->getName() << "!\n";
+                    std::cout << "Error: BaseIdentifier<" << ClassIdentifier<B>::getIdentifier()->getName() << "> = Class(" << identifier->getName() << ") is forbidden.\n";
+                    std::cout << "Aborting...\n";
+                    abort();
+                }
+                this->identifier_ = identifier;
+                return *this;
+            }
+            inline Identifier* getIdentifier()
+                { return this->identifier_; }
+            inline bool isA(Identifier* identifier)
+                { return this->identifier_->isA(identifier); }
+            inline bool isDirectlyA(Identifier* identifier)
+                { return this->identifier_->isDirectlyA(identifier); }
+            inline bool isChildOf(Identifier* identifier)
+                { return this->identifier_->isChildOf(identifier); }
+            inline bool isDirectChildOf(Identifier* identifier)
+                { return this->identifier_->isDirectChildOf(identifier); }
+            inline bool isParentOf(Identifier* identifier)
+                { return this->identifier_->isParentOf(identifier); }
+            inline bool isDirectParentOf(Identifier* identifier)
+                { return this->identifier_->isDirectParentOf(identifier); }
+
+        private:
+            Identifier* identifier_;
+    };
+
+    template <class B>
+    BaseIdentifier<B>::BaseIdentifier()
+    {
+        this->identifier_ = ClassIdentifier<B>::getIdentifier();
+    }
+}
+
+#endif
Index: code/branches/main_reto_vs05/src/class_hierarchy/IdentifierIncludes.h
===================================================================
--- code/branches/main_reto_vs05/src/class_hierarchy/IdentifierIncludes.h	(revision 232)
+++ code/branches/main_reto_vs05/src/class_hierarchy/IdentifierIncludes.h	(revision 232)
@@ -0,0 +1,5 @@
+#include "ClassHierarchy.h"
+#include "Identifier.h"
+#include "IdentifierList.h"
+#include "ObjectList.h"
+#include "OrxonoxClass.h"
Index: code/branches/main_reto_vs05/src/class_hierarchy/IdentifierList.cc
===================================================================
--- code/branches/main_reto_vs05/src/class_hierarchy/IdentifierList.cc	(revision 232)
+++ code/branches/main_reto_vs05/src/class_hierarchy/IdentifierList.cc	(revision 232)
@@ -0,0 +1,106 @@
+#include "IdentifierList.h"
+#include "Identifier.h"
+
+namespace orxonox
+{
+    // ###############################
+    // ###     IdentifierList      ###
+    // ###############################
+    IdentifierList::IdentifierList()
+    {
+        this->first_ = 0;
+    }
+
+    IdentifierList::~IdentifierList()
+    {
+        IdentifierListElement* temp;
+        while (this->first_)
+        {
+            temp = this->first_->next_;
+            delete this->first_;
+            this->first_ = temp;
+        }
+    }
+
+    void IdentifierList::add(Identifier* identifier)
+    {
+        IdentifierListElement* temp = this->first_;
+        this->first_ = new IdentifierListElement(identifier);
+        this->first_->next_ = temp;
+    }
+
+    void IdentifierList::remove(Identifier* identifier)
+    {
+        if (!identifier)
+            return;
+
+        if (this->first_->identifier_ == identifier)
+        {
+            IdentifierListElement* temp = this->first_->next_;
+            delete this->first_;
+            this->first_ = temp;
+
+            return;
+        }
+
+        IdentifierListElement* temp = this->first_;
+        while (temp->next_)
+        {
+            if (temp->next_->identifier_ == identifier)
+            {
+                IdentifierListElement* temp2 = temp->next_->next_;
+                delete temp->next_;
+                temp->next_ = temp2;
+
+                return;
+            }
+
+            temp = temp->next_;
+        }
+    }
+
+    bool IdentifierList::isInList(Identifier* identifier)
+    {
+        IdentifierListElement* temp = this->first_;
+        while (temp)
+        {
+            if (temp->identifier_ == identifier)
+                return true;
+
+            temp = temp->next_;
+        }
+
+        return false;
+    }
+
+    std::string IdentifierList::toString()
+    {
+        IdentifierListElement* temp = this->first_;
+        std::string output = "";
+
+        while (temp)
+        {
+            output += temp->identifier_->getName();
+            output += " ";
+
+            temp = temp->next_;
+        }
+
+        return output;
+    }
+
+
+    // ###############################
+    // ###  IdentifierListElement  ###
+    // ###############################
+    IdentifierListElement::IdentifierListElement(Identifier* identifier)
+    {
+        this->identifier_ = identifier;
+        this->next_ = 0;
+        this->bDirect_ = true;
+    }
+
+    IdentifierListElement::~IdentifierListElement()
+    {
+    }
+}
Index: code/branches/main_reto_vs05/src/class_hierarchy/IdentifierList.h
===================================================================
--- code/branches/main_reto_vs05/src/class_hierarchy/IdentifierList.h	(revision 232)
+++ code/branches/main_reto_vs05/src/class_hierarchy/IdentifierList.h	(revision 232)
@@ -0,0 +1,35 @@
+#ifndef _IdentifierList_H__
+#define _IdentifierList_H__
+
+#include <string>
+
+namespace orxonox
+{
+    class Identifier;
+
+    class IdentifierListElement
+    {
+        public:
+            IdentifierListElement(Identifier* identifier);
+            ~IdentifierListElement();
+
+            Identifier* identifier_;
+            IdentifierListElement* next_;
+            bool bDirect_;
+    };
+
+    class IdentifierList
+    {
+        public:
+            IdentifierList();
+            ~IdentifierList();
+            void add(Identifier* identifier);
+            void remove(Identifier* identifier);
+            bool isInList(Identifier* identifier);
+            std::string toString();
+
+            IdentifierListElement* first_;
+    };
+}
+
+#endif
Index: code/branches/main_reto_vs05/src/class_hierarchy/ObjectList.cc
===================================================================
--- code/branches/main_reto_vs05/src/class_hierarchy/ObjectList.cc	(revision 232)
+++ code/branches/main_reto_vs05/src/class_hierarchy/ObjectList.cc	(revision 232)
@@ -0,0 +1,74 @@
+#include "ObjectList.h"
+
+namespace orxonox
+{
+    // ###############################
+    // ###       ObjectList        ###
+    // ###############################
+    ObjectList::ObjectList()
+    {
+        this->first_ = 0;
+    }
+
+    ObjectList::~ObjectList()
+    {
+        ObjectListElement* temp;
+        while (this->first_)
+        {
+            temp = this->first_->next_;
+            delete this->first_;
+            this->first_ = temp;
+        }
+    }
+
+    void ObjectList::add(OrxonoxClass* object)
+    {
+        ObjectListElement* temp = this->first_;
+        this->first_ = new ObjectListElement(object);
+        this->first_->next_ = temp;
+    }
+
+    void ObjectList::remove(OrxonoxClass* object)
+    {
+        if (!object)
+            return;
+
+        if (this->first_->object_ == object)
+        {
+            ObjectListElement* temp = this->first_->next_;
+            delete this->first_;
+            this->first_ = temp;
+
+            return;
+        }
+
+        ObjectListElement* temp = this->first_;
+        while (temp->next_)
+        {
+            if (temp->next_->object_ == object)
+            {
+                ObjectListElement* temp2 = temp->next_->next_;
+                delete temp->next_;
+                temp->next_ = temp2;
+
+                return;
+            }
+
+            temp = temp->next_;
+        }
+    }
+
+
+    // ###############################
+    // ###    ObjectListElement    ###
+    // ###############################
+    ObjectListElement::ObjectListElement(OrxonoxClass* object)
+    {
+        this->object_ = object;
+        this->next_ = 0;
+    }
+
+    ObjectListElement::~ObjectListElement()
+    {
+    }
+}
Index: code/branches/main_reto_vs05/src/class_hierarchy/ObjectList.h
===================================================================
--- code/branches/main_reto_vs05/src/class_hierarchy/ObjectList.h	(revision 232)
+++ code/branches/main_reto_vs05/src/class_hierarchy/ObjectList.h	(revision 232)
@@ -0,0 +1,30 @@
+#ifndef _ObjectList_H__
+#define _ObjectList_H__
+
+namespace orxonox
+{
+    class OrxonoxClass;
+
+    class ObjectListElement
+    {
+        public:
+            ObjectListElement(OrxonoxClass* object);
+            ~ObjectListElement();
+
+            OrxonoxClass* object_;
+            ObjectListElement* next_;
+    };
+
+    class ObjectList
+    {
+        public:
+            ObjectList();
+            ~ObjectList();
+            void add(OrxonoxClass* object);
+            void remove(OrxonoxClass* object);
+
+            ObjectListElement* first_;
+    };
+}
+
+#endif
Index: code/branches/main_reto_vs05/src/class_hierarchy/OrxonoxClass.cc
===================================================================
--- code/branches/main_reto_vs05/src/class_hierarchy/OrxonoxClass.cc	(revision 232)
+++ code/branches/main_reto_vs05/src/class_hierarchy/OrxonoxClass.cc	(revision 232)
@@ -0,0 +1,17 @@
+#include "ClassHierarchy.h"
+#include "OrxonoxClass.h"
+
+namespace orxonox
+{
+    OrxonoxClass::OrxonoxClass()
+    {
+        this->identifier_ = 0;
+        this->parents_ = 0;
+    }
+
+    OrxonoxClass::~OrxonoxClass()
+    {
+        if (this->parents_)
+            delete this->parents_;
+    }
+}
Index: code/branches/main_reto_vs05/src/class_hierarchy/OrxonoxClass.h
===================================================================
--- code/branches/main_reto_vs05/src/class_hierarchy/OrxonoxClass.h	(revision 232)
+++ code/branches/main_reto_vs05/src/class_hierarchy/OrxonoxClass.h	(revision 232)
@@ -0,0 +1,25 @@
+#ifndef _OrxonoxClass_H__
+#define _OrxonoxClass_H__
+
+#include "IdentifierList.h"
+#include "Identifier.h"
+
+namespace orxonox
+{
+    class OrxonoxClass
+    {
+        public:
+            OrxonoxClass();
+            ~OrxonoxClass();
+            Identifier* getIdentifier() { return this->identifier_; }
+            void setIdentifier(Identifier* identifier) { this->identifier_ = identifier; }
+            IdentifierList* getParents() { return this->parents_; }
+            void setParents(IdentifierList* parents) { this->parents_ = parents; }
+
+        private:
+            Identifier* identifier_;
+            IdentifierList* parents_;
+    };
+}
+
+#endif
Index: code/branches/main_reto_vs05/src/class_hierarchy/Test.h
===================================================================
--- code/branches/main_reto_vs05/src/class_hierarchy/Test.h	(revision 232)
+++ code/branches/main_reto_vs05/src/class_hierarchy/Test.h	(revision 232)
@@ -0,0 +1,129 @@
+#ifndef _Test_H__
+#define _Test_H__
+
+#include "IdentifierIncludes.h"
+
+namespace orxonox
+{
+    class Interface1 : virtual public OrxonoxClass
+    {
+        public:
+            Interface1() { registerRootObject(Interface1); }
+    };
+
+    class Interface2 : virtual public OrxonoxClass
+    {
+        public:
+            Interface2() { registerRootObject(Interface2); }
+    };
+
+    class A1 : public BaseObject
+    {
+        public:
+            A1() { registerObject(A1); }
+    };
+
+    class A2 : public BaseObject
+    {
+        public:
+            A2() { registerObject(A2); }
+    };
+
+    class A3: public BaseObject, public Interface1
+    {
+        public:
+            A3() { registerObject(A3); }
+    };
+
+    class A1B1 : public A1
+    {
+        public:
+            A1B1() { registerObject(A1B1); }
+    };
+
+    class A1B2 : public A1
+    {
+        public:
+            A1B2() { registerObject(A1B2); }
+    };
+
+    class A2B1 : public A2
+    {
+        public:
+            A2B1() { registerObject(A2B1); }
+    };
+
+    class A2B2 : public A2, Interface1
+    {
+        public:
+            A2B2() { registerObject(A2B2); }
+    };
+
+    class A3B1 : public A3
+    {
+        public:
+            A3B1() { registerObject(A3B1); }
+    };
+
+    class A3B2 : public A3, Interface2
+    {
+        public:
+            A3B2() { registerObject(A3B2); }
+    };
+
+    class A1B1C1 : public A1B1
+    {
+        public:
+            A1B1C1() { registerObject(A1B1C1); }
+    };
+
+    class A1B1C2 : public A1B1
+    {
+        public:
+            A1B1C2() { registerObject(A1B1C2); }
+    };
+
+    class A1B2C1 : public A1B2
+    {
+        public:
+            A1B2C1() { registerObject(A1B2C1); }
+    };
+
+    class A2B1C1 : public A2B1, Interface2
+    {
+        public:
+            A2B1C1() { registerObject(A2B1C1); }
+    };
+
+    class A2B2C1 : public A2B2
+    {
+        public:
+            A2B2C1() { registerObject(A2B2C1); }
+    };
+
+    class A3B1C1 : public A3B1
+    {
+        public:
+            A3B1C1() { registerObject(A3B1C1); }
+    };
+
+    class A3B1C2 : public A3B1, Interface2
+    {
+        public:
+            A3B1C2() { registerObject(A3B1C2); }
+    };
+
+    class A3B2C1 : public A3B2
+    {
+        public:
+            A3B2C1() { registerObject(A3B2C1); }
+    };
+
+    class A3B2C2 : public A3B2
+    {
+        public:
+            A3B2C2() { registerObject(A3B2C2); }
+    };
+}
+
+#endif
Index: code/branches/main_reto_vs05/src/class_hierarchy/orxonox.cc
===================================================================
--- code/branches/main_reto_vs05/src/class_hierarchy/orxonox.cc	(revision 232)
+++ code/branches/main_reto_vs05/src/class_hierarchy/orxonox.cc	(revision 232)
@@ -0,0 +1,294 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *
+ *
+ *   License notice:
+ *
+ *   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 3 of the License, or
+ *   (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *   Author:
+ *      Benjamin Knecht <beni_at_orxonox.net>, (C) 2007
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include <Ogre.h>
+#include <OIS/OIS.h>
+#include <CEGUI/CEGUI.h>
+#include <OgreCEGUIRenderer.h>
+
+#include "BaseObject.h"
+#include "Test.h"
+#include "test1.h"
+#include "test2.h"
+#include "test3.h"
+
+#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
+#include <CoreFoundation/CoreFoundation.h>
+
+// This function will locate the path to our application on OS X,
+// unlike windows you can not rely on the curent working directory
+// for locating your configuration files and resources.
+std::string macBundlePath()
+{
+  char path[1024];
+  CFBundleRef mainBundle = CFBundleGetMainBundle();
+  assert(mainBundle);
+
+  CFURLRef mainBundleURL = CFBundleCopyBundleURL(mainBundle);
+  assert(mainBundleURL);
+
+  CFStringRef cfStringRef = CFURLCopyFileSystemPath( mainBundleURL, kCFURLPOSIXPathStyle);
+  assert(cfStringRef);
+
+  CFStringGetCString(cfStringRef, path, 1024, kCFStringEncodingASCII);
+
+  CFRelease(mainBundleURL);
+  CFRelease(cfStringRef);
+
+  return std::string(path);
+}
+#endif
+
+namespace orxonox
+{
+  class OrxExitListener : public Ogre::FrameListener
+  {
+    public:
+      OrxExitListener(OIS::Keyboard *keyboard)
+    : mKeyboard(keyboard)
+      {
+      }
+
+      bool frameStarted(const Ogre::FrameEvent& evt)
+      {
+        mKeyboard->capture();
+        return !mKeyboard->isKeyDown(OIS::KC_ESCAPE);
+      }
+
+    private:
+      OIS::Keyboard *mKeyboard;
+  };
+
+  class OrxApplication
+  {
+    public:
+      void go()
+      {
+
+        #define testandcout(code) \
+          std::cout << #code << " " << code << "\n"
+
+
+        std::cout << "Test 8\n";
+
+        std::cout << "1\n";
+        Test1* test8_01 = new Test1;
+        Test3* test8_03 = new Test3;
+        test8_03->usefullClassesIsATest(test8_01);
+
+        std::cout << "2\n";
+        Test2* test8_02 = new Test2;
+        test8_03->usefullClassesIsATest(test8_02);
+
+        std::cout << "3\n";
+        test8_01->setUsefullClass1(Class(Test1));
+        test8_01->setUsefullClass1(test8_02->getIdentifier());
+        test8_01->setUsefullClass2(Class(Test2));
+        test8_01->setUsefullClassOfTypeTest3(Class(Test3));
+        test8_01->setUsefullClassOfTypeTest3(test8_03->getIdentifier());
+
+
+        testandcout(test8_01->isA(Class(Test1)));
+        testandcout(test8_01->isA(Class(Test2)));
+        testandcout(test8_01->isA(Class(Test3)));
+
+        Test2* test8_04 = new Test2;
+        testandcout(test8_02->isA(Class(Test1)));
+        testandcout(test8_02->isA(Class(Test2)));
+        testandcout(test8_02->isA(Class(Test3)));
+
+        Test3* test8_05 = new Test3;
+        testandcout(test8_03->isA(Class(Test1)));
+        testandcout(test8_03->isA(Class(Test2)));
+        testandcout(test8_03->isA(Class(Test3)));
+
+        delete test8_01;
+        delete test8_02;
+        delete test8_03;
+
+
+      }
+
+      ~OrxApplication()
+      {
+        mInputManager->destroyInputObject(mKeyboard);
+        OIS::InputManager::destroyInputSystem(mInputManager);
+
+        delete mRenderer;
+        delete mSystem;
+
+        delete mListener;
+        delete mRoot;
+      }
+
+    private:
+      Ogre::Root *mRoot;
+      OIS::Keyboard *mKeyboard;
+      OIS::Mouse *mMouse;
+      OIS::InputManager *mInputManager;
+      CEGUI::OgreCEGUIRenderer *mRenderer;
+      CEGUI::System *mSystem;
+      OrxExitListener *mListener;
+
+      void createRoot()
+      {
+#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
+        mRoot = new Ogre::Root(macBundlePath() + "/Contents/Resources/plugins.cfg");
+#else
+        mRoot = new Ogre::Root();
+#endif
+      }
+
+      void defineResources()
+      {
+        Ogre::String secName, typeName, archName;
+        Ogre::ConfigFile cf;
+#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
+        cf.load(macBundlePath() + "/Contents/Resources/resources.cfg");
+#else
+        cf.load("resources.cfg");
+#endif
+
+        Ogre::ConfigFile::SectionIterator seci = cf.getSectionIterator();
+        while (seci.hasMoreElements())
+        {
+          secName = seci.peekNextKey();
+          Ogre::ConfigFile::SettingsMultiMap *settings = seci.getNext();
+          Ogre::ConfigFile::SettingsMultiMap::iterator i;
+          for (i = settings->begin(); i != settings->end(); ++i)
+          {
+            typeName = i->first;
+            archName = i->second;
+#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
+            Ogre::ResourceGroupManager::getSingleton().addResourceLocation( String(macBundlePath() + "/" + archName), typeName, secName);
+#else
+            Ogre::ResourceGroupManager::getSingleton().addResourceLocation( archName, typeName, secName);
+#endif
+          }
+        }
+      }
+
+      void setupRenderSystem()
+      {
+        if (!mRoot->restoreConfig() && !mRoot->showConfigDialog())
+          throw Ogre::Exception(52, "User canceled the config dialog!", "OrxApplication::setupRenderSystem()");
+      }
+
+      void createRenderWindow()
+      {
+        mRoot->initialise(true, "Ogre Render Window");
+      }
+
+      void initializeResourceGroups()
+      {
+        Ogre::TextureManager::getSingleton().setDefaultNumMipmaps(5);
+        Ogre::ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
+      }
+
+      void setupScene()
+      {
+        Ogre::SceneManager *mgr = mRoot->createSceneManager(Ogre::ST_GENERIC, "Default SceneManager");
+        Ogre::Camera *cam = mgr->createCamera("Camera");
+        Ogre::Viewport *vp = mRoot->getAutoCreatedWindow()->addViewport(cam);
+      }
+
+      void setupInputSystem()
+      {
+        size_t windowHnd = 0;
+        std::ostringstream windowHndStr;
+        OIS::ParamList pl;
+        Ogre::RenderWindow *win = mRoot->getAutoCreatedWindow();
+
+        win->getCustomAttribute("WINDOW", &windowHnd);
+        windowHndStr << windowHnd;
+        pl.insert(std::make_pair(std::string("WINDOW"), windowHndStr.str()));
+        mInputManager = OIS::InputManager::createInputSystem(pl);
+
+        try
+        {
+          mKeyboard = static_cast<OIS::Keyboard*>(mInputManager->createInputObject(OIS::OISKeyboard, false));
+          mMouse = static_cast<OIS::Mouse*>(mInputManager->createInputObject(OIS::OISMouse, false));
+        }
+        catch (const OIS::Exception &e)
+        {
+          throw new Ogre::Exception(42, e.eText, "OrxApplication::setupInputSystem");
+        }
+      }
+
+      void setupCEGUI()
+      {
+        Ogre::SceneManager *mgr = mRoot->getSceneManager("Default SceneManager");
+        Ogre::RenderWindow *win = mRoot->getAutoCreatedWindow();
+
+        // CEGUI setup
+        mRenderer = new CEGUI::OgreCEGUIRenderer(win, Ogre::RENDER_QUEUE_OVERLAY, false, 3000, mgr);
+        mSystem = new CEGUI::System(mRenderer);
+
+        // Other CEGUI setup here.
+      }
+
+      void createFrameListener()
+      {
+        mListener = new OrxExitListener(mKeyboard);
+        mRoot->addFrameListener(mListener);
+      }
+
+      void startRenderLoop()
+      {
+        mRoot->startRendering();
+      }
+  };
+}
+
+using namespace Ogre;
+
+#if OGRE_PLATFORM == PLATFORM_WIN32 || OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+#define WIN32_LEAN_AND_MEAN
+#include "windows.h"
+
+             INT WINAPI WinMain(HINSTANCE hInst, HINSTANCE, LPSTR strCmdLine, INT)
+#else
+             int main(int argc, char **argv)
+#endif
+{
+  try
+  {
+    orxonox::OrxApplication orxonox;
+    orxonox.go();
+  }
+  catch(Exception& e)
+  {
+#if OGRE_PLATFORM == PLATFORM_WIN32 || OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+    MessageBoxA(NULL, e.getFullDescription().c_str(), "An exception has occurred!", MB_OK | MB_ICONERROR | MB_TASKMODAL);
+#else
+    fprintf(stderr, "An exception has occurred: %s\n",
+            e.getFullDescription().c_str());
+#endif
+  }
+
+  return 0;
+}
Index: code/branches/main_reto_vs05/src/class_hierarchy/test1.cc
===================================================================
--- code/branches/main_reto_vs05/src/class_hierarchy/test1.cc	(revision 232)
+++ code/branches/main_reto_vs05/src/class_hierarchy/test1.cc	(revision 232)
@@ -0,0 +1,61 @@
+#include "test1.h"
+#include "test2.h"
+#include "test3.h"
+
+namespace orxonox
+{
+    Test1::Test1()
+    {
+        registerObject(Test1);
+
+        this->usefullClass1_ = Class(Test1);
+        this->usefullClass2_ = Class(Test2);
+        this->usefullClass3_ = Class(Test3);
+    }
+
+    Test1::~Test1()
+    {
+    }
+
+    bool Test1::usefullClass1isA(Identifier* identifier)
+    {
+        return this->usefullClass1_->isA(identifier);
+    }
+
+    bool Test1::usefullClass2isA(Identifier* identifier)
+    {
+        return this->usefullClass2_->isA(identifier);
+    }
+
+    bool Test1::usefullClass3isA(Identifier* identifier)
+    {
+        return this->usefullClass3_.isA(identifier);
+    }
+
+    void Test1::setUsefullClass1(Identifier* identifier)
+    {
+        std::cout << "\n";
+        std::cout << "Test1: usefullClass1->isA(Class(Test1)): " << identifier->isA(Class(Test1)) << "\n";
+        std::cout << "Test1: usefullClass1->isA(Class(Test2)): " << identifier->isA(Class(Test2)) << "\n";
+        std::cout << "Test1: usefullClass1->isA(Class(Test3)): " << identifier->isA(Class(Test3)) << "\n";
+        this->usefullClass1_ = identifier;
+    }
+
+    void Test1::setUsefullClass2(Identifier* identifier)
+    {
+        std::cout << "\n";
+        std::cout << "Test1: usefullClass2->isA(Class(Test1)): " << identifier->isA(Class(Test1)) << "\n";
+        std::cout << "Test1: usefullClass2->isA(Class(Test2)): " << identifier->isA(Class(Test2)) << "\n";
+        std::cout << "Test1: usefullClass2->isA(Class(Test3)): " << identifier->isA(Class(Test3)) << "\n";
+        this->usefullClass2_ = identifier;
+    }
+
+    void Test1::setUsefullClassOfTypeTest3(Identifier* identifier)
+    {
+        std::cout << "\n";
+        std::cout << "Test1: usefullClass3->isA(Class(Test1)): " << identifier->isA(Class(Test1)) << "\n";
+        std::cout << "Test1: usefullClass3->isA(Class(Test2)): " << identifier->isA(Class(Test2)) << "\n";
+        std::cout << "Test1: usefullClass3->isA(Class(Test3)): " << identifier->isA(Class(Test3)) << "\n";
+        this->usefullClass3_ = identifier;
+    }
+}
Index: code/branches/main_reto_vs05/src/class_hierarchy/test1.h
===================================================================
--- code/branches/main_reto_vs05/src/class_hierarchy/test1.h	(revision 232)
+++ code/branches/main_reto_vs05/src/class_hierarchy/test1.h	(revision 232)
@@ -0,0 +1,30 @@
+#ifndef _Test1_H__
+#define _Test1_H__
+
+#include "BaseObject.h"
+#include "test3.h"
+
+namespace orxonox
+{
+    class Test1 : public BaseObject
+    {
+        public:
+            Test1();
+            virtual ~Test1();
+
+            bool usefullClass1isA(Identifier* identifier);
+            bool usefullClass2isA(Identifier* identifier);
+            bool usefullClass3isA(Identifier* identifier);
+            void setUsefullClass1(Identifier* identifier);
+            void setUsefullClass2(Identifier* identifier);
+            void setUsefullClassOfTypeTest3(Identifier* identifier);
+
+        private:
+            Identifier* usefullClass1_;
+            Identifier* usefullClass2_;
+            BaseIdentifier<Test3> usefullClass3_;
+
+    };
+}
+
+#endif
Index: code/branches/main_reto_vs05/src/class_hierarchy/test2.cc
===================================================================
--- code/branches/main_reto_vs05/src/class_hierarchy/test2.cc	(revision 232)
+++ code/branches/main_reto_vs05/src/class_hierarchy/test2.cc	(revision 232)
@@ -0,0 +1,61 @@
+#include "test1.h"
+#include "test2.h"
+#include "test3.h"
+
+namespace orxonox
+{
+    Test2::Test2()
+    {
+        registerObject(Test2);
+
+        this->usefullClass1_ = Class(Test1);
+        this->usefullClass2_ = Class(Test2);
+        this->usefullClass3_ = Class(Test3);
+    }
+
+    Test2::~Test2()
+    {
+    }
+
+    bool Test2::usefullClass1isA(Identifier* identifier)
+    {
+        return this->usefullClass1_->isA(identifier);
+    }
+
+    bool Test2::usefullClass2isA(Identifier* identifier)
+    {
+        return this->usefullClass2_->isA(identifier);
+    }
+
+    bool Test2::usefullClass3isA(Identifier* identifier)
+    {
+        return this->usefullClass3_.isA(identifier);
+    }
+
+    void Test2::setUsefullClass1(Identifier* identifier)
+    {
+        std::cout << "\n";
+        std::cout << "Test2: usefullClass1->isA(Class(Test1)): " << identifier->isA(Class(Test1)) << "\n";
+        std::cout << "Test2: usefullClass1->isA(Class(Test2)): " << identifier->isA(Class(Test2)) << "\n";
+        std::cout << "Test2: usefullClass1->isA(Class(Test3)): " << identifier->isA(Class(Test3)) << "\n";
+        this->usefullClass1_ = identifier;
+    }
+
+    void Test2::setUsefullClass2(Identifier* identifier)
+    {
+        std::cout << "\n";
+        std::cout << "Test2: usefullClass2->isA(Class(Test1)): " << identifier->isA(Class(Test1)) << "\n";
+        std::cout << "Test2: usefullClass2->isA(Class(Test2)): " << identifier->isA(Class(Test2)) << "\n";
+        std::cout << "Test2: usefullClass2->isA(Class(Test3)): " << identifier->isA(Class(Test3)) << "\n";
+        this->usefullClass2_ = identifier;
+    }
+
+    void Test2::setUsefullClassOfTypeTest3(Identifier* identifier)
+    {
+        std::cout << "\n";
+        std::cout << "Test2: usefullClass3->isA(Class(Test1)): " << identifier->isA(Class(Test1)) << "\n";
+        std::cout << "Test2: usefullClass3->isA(Class(Test2)): " << identifier->isA(Class(Test2)) << "\n";
+        std::cout << "Test2: usefullClass3->isA(Class(Test3)): " << identifier->isA(Class(Test3)) << "\n";
+        this->usefullClass3_ = identifier;
+    }
+}
Index: code/branches/main_reto_vs05/src/class_hierarchy/test2.h
===================================================================
--- code/branches/main_reto_vs05/src/class_hierarchy/test2.h	(revision 232)
+++ code/branches/main_reto_vs05/src/class_hierarchy/test2.h	(revision 232)
@@ -0,0 +1,31 @@
+#ifndef _Test2_H__
+#define _Test2_H__
+
+#include "BaseObject.h"
+
+namespace orxonox
+{
+    class Test3;
+
+    class Test2 : public BaseObject
+    {
+        public:
+            Test2();
+            virtual ~Test2();
+
+            bool usefullClass1isA(Identifier* identifier);
+            bool usefullClass2isA(Identifier* identifier);
+            bool usefullClass3isA(Identifier* identifier);
+            void setUsefullClass1(Identifier* identifier);
+            void setUsefullClass2(Identifier* identifier);
+            void setUsefullClassOfTypeTest3(Identifier* identifier);
+
+        private:
+            Identifier* usefullClass1_;
+            Identifier* usefullClass2_;
+            BaseIdentifier<Test3> usefullClass3_;
+
+    };
+}
+
+#endif
Index: code/branches/main_reto_vs05/src/class_hierarchy/test3.cc
===================================================================
--- code/branches/main_reto_vs05/src/class_hierarchy/test3.cc	(revision 232)
+++ code/branches/main_reto_vs05/src/class_hierarchy/test3.cc	(revision 232)
@@ -0,0 +1,53 @@
+#include "test1.h"
+#include "test2.h"
+#include "test3.h"
+
+namespace orxonox
+{
+    Test3::Test3()
+    {
+        registerObject(Test3);
+    }
+
+    Test3::~Test3()
+    {
+    }
+        #define testandcout(code) \
+          std::cout << #code << " " << code << "\n"
+
+    bool Test3::usefullClassesIsATest(Test1* test1)
+    {
+        std::cout << "\n";
+        std::cout << "Test1:\n";
+        testandcout(test1->usefullClass1isA(Class(Test1)));
+        testandcout(test1->usefullClass1isA(Class(Test2)));
+        testandcout(test1->usefullClass1isA(Class(Test3)));
+        std::cout << "\n";
+        testandcout(test1->usefullClass2isA(Class(Test1)));
+        testandcout(test1->usefullClass2isA(Class(Test2)));
+        testandcout(test1->usefullClass2isA(Class(Test3)));
+        std::cout << "\n";
+        testandcout(test1->usefullClass3isA(Class(Test1)));
+        testandcout(test1->usefullClass3isA(Class(Test2)));
+        testandcout(test1->usefullClass3isA(Class(Test3)));
+        return true;
+    }
+
+    bool Test3::usefullClassesIsATest(Test2* test2)
+    {
+        std::cout << "\n";
+        std::cout << "Test2:\n";
+        testandcout(test2->usefullClass1isA(Class(Test1)));
+        testandcout(test2->usefullClass1isA(Class(Test2)));
+        testandcout(test2->usefullClass1isA(Class(Test3)));
+        std::cout << "\n";
+        testandcout(test2->usefullClass2isA(Class(Test1)));
+        testandcout(test2->usefullClass2isA(Class(Test2)));
+        testandcout(test2->usefullClass2isA(Class(Test3)));
+        std::cout << "\n";
+        testandcout(test2->usefullClass3isA(Class(Test1)));
+        testandcout(test2->usefullClass3isA(Class(Test2)));
+        testandcout(test2->usefullClass3isA(Class(Test3)));
+        return true;
+    }
+}
Index: code/branches/main_reto_vs05/src/class_hierarchy/test3.h
===================================================================
--- code/branches/main_reto_vs05/src/class_hierarchy/test3.h	(revision 232)
+++ code/branches/main_reto_vs05/src/class_hierarchy/test3.h	(revision 232)
@@ -0,0 +1,22 @@
+#ifndef _Test3_H__
+#define _Test3_H__
+
+#include "BaseObject.h"
+
+namespace orxonox
+{
+    class Test1;
+    class Test2;
+
+    class Test3 : public BaseObject
+    {
+        public:
+            Test3();
+            virtual ~Test3();
+
+            bool usefullClassesIsATest(Test1* test1);
+            bool usefullClassesIsATest(Test2* test2);
+    };
+}
+
+#endif
Index: code/branches/main_reto_vs05/src/main.cc
===================================================================
--- code/branches/main_reto_vs05/src/main.cc	(revision 198)
+++ code/branches/main_reto_vs05/src/main.cc	(revision 232)
@@ -31,4 +31,11 @@
 #include "orxonox.h"
 
+#include "class_hierarchy/BaseObject.h"
+#include "class_hierarchy/Test.h"
+#include "class_hierarchy/test1.h"
+#include "class_hierarchy/test2.h"
+#include "class_hierarchy/test3.h"
+
+
 #ifdef __cplusplus
 extern "C" {
@@ -43,4 +50,5 @@
 #endif 
   {
+#if 1
     try {
       // create an orxonox application and run it
@@ -60,4 +68,49 @@
     }
 
+#else
+#define testandcout(code) \
+    std::cout << #code << " " << code << "\n"
+
+    using namespace orxonox;
+
+    std::cout << "Test 8\n";
+
+    std::cout << "1\n";
+    Test1* test8_01 = new Test1;
+    Test1* asdf = new Test1;
+    Test3* test8_03 = new Test3;
+    test8_03->usefullClassesIsATest(test8_01);
+
+    std::cout << "2\n";
+    Test2* test8_02 = new Test2;
+    test8_03->usefullClassesIsATest(test8_02);
+
+    std::cout << "3\n";
+    test8_01->setUsefullClass1(Class(Test1));
+    test8_01->setUsefullClass1(test8_02->getIdentifier());
+    test8_01->setUsefullClass2(Class(Test2));
+    test8_01->setUsefullClassOfTypeTest3(Class(Test3));
+    test8_01->setUsefullClassOfTypeTest3(test8_03->getIdentifier());
+
+
+    testandcout(test8_01->isA(Class(Test1)));
+    testandcout(test8_01->isA(Class(Test2)));
+    testandcout(test8_01->isA(Class(Test3)));
+
+    Test2* test8_04 = new Test2;
+    testandcout(test8_02->isA(Class(Test1)));
+    testandcout(test8_02->isA(Class(Test2)));
+    testandcout(test8_02->isA(Class(Test3)));
+
+    Test3* test8_05 = new Test3;
+    testandcout(test8_03->isA(Class(Test1)));
+    testandcout(test8_03->isA(Class(Test2)));
+    testandcout(test8_03->isA(Class(Test3)));
+
+    delete test8_01;
+    delete test8_02;
+    delete test8_03;
+
+#endif
     return 0;
   }
Index: code/branches/main_reto_vs05/src/orxonox_prerequisites.h
===================================================================
--- code/branches/main_reto_vs05/src/orxonox_prerequisites.h	(revision 198)
+++ code/branches/main_reto_vs05/src/orxonox_prerequisites.h	(revision 232)
@@ -47,4 +47,5 @@
     class BulletManager;
     class BaseWeapon;
+    class BarrelGun;
     class WeaponStation;
 
Index: code/branches/main_reto_vs05/src/orxonox_ship.cc
===================================================================
--- code/branches/main_reto_vs05/src/orxonox_ship.cc	(revision 198)
+++ code/branches/main_reto_vs05/src/orxonox_ship.cc	(revision 232)
@@ -34,8 +34,10 @@
 
 #include "inertial_node.h"
+#include "run_manager.h"
 #include "weapon/bullet.h"
 #include "weapon/bullet_manager.h"
 #include "weapon/weapon_station.h"
 #include "weapon/base_weapon.h"
+#include "weapon/barrel_gun.h"
 #include "weapon/ammunition_dump.h"
 
@@ -68,9 +70,8 @@
   * @param mNode The scene node which the ship will be attached to later.
   */
-  OrxonoxShip::OrxonoxShip(SceneManager *sceneMgr, SceneNode *node,
-        BulletManager *bulletManager)
-	      : sceneMgr_(sceneMgr),
-        baseThrust_(1000), currentThrust_(Vector3::ZERO),
-        objectCounter_(0), bulletManager_(bulletManager)
+  OrxonoxShip::OrxonoxShip(SceneNode *node)
+    : sceneMgr_(RunManager::getSingletonPtr()->getSceneManagerPtr()),
+      bulletManager_(RunManager::getSingletonPtr()->getBulletManagerPtr()),
+      baseThrust_(1000), currentThrust_(Vector3::ZERO), objectCounter_(0)
   {
     rootNode_ = new InertialNode(node, Vector3::ZERO);
@@ -115,10 +116,10 @@
 
     // initialise weapon(s)
-    ammoDump_ = new AmmunitionDump(420);
-    ammoDump_->store(420);
+    ammoDump_ = new AmmunitionDump();
+    ammoDump_->setDumpSize("Barrel", 1000);
+    ammoDump_->store("Barrel", 420);
 
     InertialNode *mainWeaponNode = rootNode_->createChildNode();
-    mainWeapon_ = new BaseWeapon(sceneMgr_, mainWeaponNode,
-          bulletManager_, ammoDump_);
+    mainWeapon_ = new BarrelGun(mainWeaponNode, ammoDump_);
 
     railGunStation_ = new WeaponStation(4);
@@ -216,5 +217,5 @@
   int OrxonoxShip::getAmmoStock()
   {
-    return ammoDump_->getStockSize();
+    return ammoDump_->getStockSize("Barrel");
   }
 
Index: code/branches/main_reto_vs05/src/orxonox_ship.h
===================================================================
--- code/branches/main_reto_vs05/src/orxonox_ship.h	(revision 198)
+++ code/branches/main_reto_vs05/src/orxonox_ship.h	(revision 232)
@@ -40,5 +40,5 @@
   {
   public:
-    OrxonoxShip(Ogre::SceneManager*, Ogre::SceneNode*, weapon::BulletManager*);
+    OrxonoxShip(Ogre::SceneNode*);
 	  virtual ~OrxonoxShip();
 
Index: code/branches/main_reto_vs05/src/run_manager.cc
===================================================================
--- code/branches/main_reto_vs05/src/run_manager.cc	(revision 198)
+++ code/branches/main_reto_vs05/src/run_manager.cc	(revision 232)
@@ -60,4 +60,9 @@
 #include "run_manager.h"
 
+namespace Ogre {
+  using namespace orxonox;
+  template<> RunManager* Singleton<RunManager>::ms_Singleton = 0;
+}
+
 namespace orxonox {
   using namespace Ogre;
@@ -77,4 +82,13 @@
   */
 
+  RunManager* RunManager::getSingletonPtr(void)
+  {
+      return ms_Singleton;
+  }
+  RunManager& RunManager::getSingleton(void)
+  {  
+      assert( ms_Singleton );  return ( *ms_Singleton );  
+  }
+
 
   /**
@@ -94,9 +108,8 @@
         debugOverlay_(0), inputManager_(0), mouse_(0), keyboard_(0), joystick_(0)
   {
-
     // SETTING UP THE SCENE
 
     // create one new SceneManger
-    sceneMgr_ = ogre_->getRoot()->createSceneManager(ST_GENERIC, "backgroundScene_");
+    sceneMgr_ = ogre_->getRoot()->createSceneManager(ST_GENERIC, "Orxonox Scene");
 
     // background scene (world objects, skybox, lights, etc.)
@@ -125,6 +138,6 @@
 
     // Construct a new spaceship and give it the node
-    playerShip_ = new OrxonoxShip(sceneMgr_, sceneMgr_->getRootSceneNode()
-      ->createChildSceneNode("ShipNode", Vector3(20, 20, 20)), bulletManager_);
+    playerShip_ = new OrxonoxShip(sceneMgr_->getRootSceneNode()
+      ->createChildSceneNode("ShipNode", Vector3(20, 20, 20)));
 
 
@@ -274,4 +287,38 @@
     // keep rendering
     return true;
+  }
+
+
+  SceneManager& RunManager::getSceneManager()
+  {
+    return *sceneMgr_;
+  }
+
+  SceneManager* RunManager::getSceneManagerPtr()
+  {
+    return sceneMgr_;
+  }
+
+  BulletManager* RunManager::getBulletManagerPtr()
+  {
+    return bulletManager_;
+  }
+
+  int RunManager::getAmmunitionID(const Ogre::String &ammoName)
+  {
+    Ogre::String ammoTypes[] = { "Energy Cell", "Barrel", "Lead Shot" };
+    int ammoTypesLength = 3;
+
+    for (int i = 0; i < ammoTypesLength; i++)
+    {
+      if (ammoTypes[i] == ammoName)
+        return i;
+    }
+    return -1;
+  }
+
+  int RunManager::getNumberOfAmmos()
+  {
+    return 3;
   }
 
Index: code/branches/main_reto_vs05/src/run_manager.h
===================================================================
--- code/branches/main_reto_vs05/src/run_manager.h	(revision 198)
+++ code/branches/main_reto_vs05/src/run_manager.h	(revision 232)
@@ -33,4 +33,5 @@
 #include "OgreWindowEventUtilities.h"
 #include "OgreTextureManager.h"
+#include "OgreSingleton.h"
 
 #include <OIS/OISPrereqs.h>
@@ -43,17 +44,34 @@
   // let the class inherit from WindowEventListener in order for the RunMgr
   // to act as the central point of all the calcuations in Orxonox
-  class RunManager : Ogre::WindowEventListener
+  class RunManager : public Ogre::WindowEventListener,
+                     public Ogre::Singleton<RunManager>
   {
   public:
-	  RunManager(OgreControl*);
+    RunManager(OgreControl*);
 
-	  virtual ~RunManager();
+    virtual ~RunManager();
+    //void initialise(OgreControl*);
 
-    virtual bool tick(unsigned long, Ogre::Real);
+    bool tick(unsigned long, Ogre::Real);
+
+    Ogre::SceneManager& getSceneManager();
+
+    Ogre::SceneManager* getSceneManagerPtr();
+
+    weapon::BulletManager* getBulletManagerPtr();
+
+    int getAmmunitionID(const Ogre::String&);
+
+    int getNumberOfAmmos();
+
+    static RunManager& getSingleton(void);
+
+    static RunManager* getSingletonPtr(void);
+
 
   protected:
-	  virtual void createCamera(void);
+	  void createCamera(void);
 
-	  virtual void createViewports(void);
+	  void createViewports(void);
 
 
@@ -61,21 +79,21 @@
 
 	  //Adjust mouse clipping area
-	  virtual void windowResized(Ogre::RenderWindow*);
+	  void windowResized(Ogre::RenderWindow*);
 
 	  //Unattach OIS before window shutdown (very important under Linux)
-	  virtual void windowClosed(Ogre::RenderWindow*);
+	  void windowClosed(Ogre::RenderWindow*);
 
 
 	  /** INPUT PROCESSING **/
-	  virtual bool processUnbufferedKeyInput();
+	  bool processUnbufferedKeyInput();
 
-	  virtual bool processUnbufferedMouseInput();
+	  bool processUnbufferedMouseInput();
 
 
 	  /** OUTPUT **/
 
-	  virtual void updateStats(void);
+	  void updateStats(void);
 
-	  virtual void showDebugOverlay(bool);
+	  void showDebugOverlay(bool);
 
   protected:
Index: code/branches/main_reto_vs05/src/weapon/ammunition_dump.cc
===================================================================
--- code/branches/main_reto_vs05/src/weapon/ammunition_dump.cc	(revision 198)
+++ code/branches/main_reto_vs05/src/weapon/ammunition_dump.cc	(revision 232)
@@ -26,4 +26,6 @@
  */
 
+#include "run_manager.h"
+
 #include "ammunition_dump.h"
 
@@ -32,7 +34,14 @@
 namespace weapon {
 
-  AmmunitionDump::AmmunitionDump(int capacity)
-        : stock_(0), capacity_(capacity)
+  AmmunitionDump::AmmunitionDump()
+    : numberOfAmmos_(RunManager::getSingletonPtr()->getNumberOfAmmos()),
+      stock_(new int[numberOfAmmos_]),
+      capacity_(new int[numberOfAmmos_])
   {
+    for (int i = 0; i < numberOfAmmos_; i++)
+    {
+      stock_[i] = 0;
+      capacity_[i] = 0;
+    }
   }
 
@@ -40,34 +49,60 @@
   AmmunitionDump::~AmmunitionDump()
   {
+    if (stock_)
+      delete stock_;
+    if (capacity_)
+      delete capacity_;
+  }
+
+  void AmmunitionDump::setDumpSize(const Ogre::String &name, int size)
+  {
+    if (size < 0)
+      return;
+    int id = RunManager::getSingletonPtr()->getAmmunitionID(name);
+    if (id == -1)
+      return;
+    capacity_[id] = size;
   }
 
   
-  void AmmunitionDump::store(int quantity)
+  int AmmunitionDump::store(const Ogre::String &name, int quantity)
   {
-    stock_ += quantity;
-    if (stock_ > capacity_)
-      stock_ = capacity_;
+    int id = RunManager::getSingletonPtr()->getAmmunitionID(name);
+    if (id == -1)
+      return quantity;
+    stock_[id] += quantity;
+    if (stock_[id] > capacity_[id])
+    {
+      quantity = capacity_[id] - stock_[id];
+      stock_[id] = capacity_[id];
+      return quantity;
+    }
+    else
+      return 0;
   }
 
 
-  int AmmunitionDump::getAmmunition(int quantity)
+  int AmmunitionDump::getAmmunition(const Ogre::String &name, int quantity)
   {
-    if (stock_ >= quantity)
-    {
-      stock_ -= quantity;
-      return quantity;
-    }
+    int id = RunManager::getSingletonPtr()->getAmmunitionID(name);
+    if (id == -1)
+      return 0;
+    if (stock_[id] >= quantity)
+      stock_[id] -= quantity;
     else
     {
-      quantity = stock_;
-      stock_ = 0;
-      return quantity;
+      quantity = stock_[id];
+      stock_[id] = 0;
     }
+    return quantity;
   }
 
 
-  int AmmunitionDump::getStockSize()
+  int AmmunitionDump::getStockSize(const Ogre::String &name)
   {
-    return stock_;
+    int id = RunManager::getSingletonPtr()->getAmmunitionID(name);
+    if (id = -1)
+      return -1;
+    return stock_[id];
   }
 }
Index: code/branches/main_reto_vs05/src/weapon/ammunition_dump.h
===================================================================
--- code/branches/main_reto_vs05/src/weapon/ammunition_dump.h	(revision 198)
+++ code/branches/main_reto_vs05/src/weapon/ammunition_dump.h	(revision 232)
@@ -41,16 +41,19 @@
   {
   public:
-	  AmmunitionDump(int capacity);
+    AmmunitionDump();
 	  ~AmmunitionDump();
 
-    void store(int quantiy);
+    void setDumpSize(const Ogre::String &name, int size);
 
-    int getAmmunition(int quantity);
+    int store(const Ogre::String &name, int quantiy);
 
-    int getStockSize();
+    int getAmmunition(const Ogre::String &name, int quantity);
+
+    int getStockSize(const Ogre::String &name);
 
   protected:
-    int stock_;
-    int capacity_;
+    int numberOfAmmos_;
+    int *stock_;
+    int *capacity_;
 
   protected:
Index: code/branches/main_reto_vs05/src/weapon/barrel_gun.cc
===================================================================
--- code/branches/main_reto_vs05/src/weapon/barrel_gun.cc	(revision 232)
+++ code/branches/main_reto_vs05/src/weapon/barrel_gun.cc	(revision 232)
@@ -0,0 +1,140 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *
+ *
+ *   License notice:
+ *
+ *   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 3 of the License, or
+ *   (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "OgreMath.h"
+#include "OgreVector3.h"
+#include "OgreStringConverter.h"
+#include "OgreSceneNode.h"
+#include "OgreEntity.h"
+#include "OgreSceneManager.h"
+
+#include "bullet.h"
+#include "bullet_manager.h"
+#include "inertial_node.h"
+#include "ammunition_dump.h"
+#include "base_weapon.h"
+
+#include "barrel_gun.h"
+
+
+namespace orxonox {
+namespace weapon {
+  using namespace Ogre;
+
+  BarrelGun::BarrelGun(InertialNode *node, AmmunitionDump *ammoDump)
+        : BaseWeapon(node, ammoDump)
+  {
+    name_ = "Barrel Gun";
+    primaryFirePower_ = 100;
+    secondaryFirePower_ = 500;
+    primaryFiringRate_ = 10;
+    secondaryFiringRate_ = 2;
+    primaryBulletSpeed_ = 1000;
+    secondaryBulletSpeed_ = 500;
+    magazineSize_ = 25;
+  }
+
+
+  BarrelGun::~BarrelGun()
+  {
+  }
+
+
+  void BarrelGun::primaryFire()
+  {
+    if (leftAmmo_ < 1)
+    {
+      currentState_ = IDLE;
+      return;
+    }
+
+    SceneNode *temp = sceneMgr_->getRootSceneNode()->createChildSceneNode(
+          node_->getSceneNode()->getWorldPosition(),
+          node_->getSceneNode()->getWorldOrientation());
+
+    Entity* bulletEntity = sceneMgr_->createEntity("BulletEntity"
+          + StringConverter::toString(bulletCounter_++), "Barrel.mesh");
+
+    Vector3 speed = (temp->getOrientation() * Vector3(0, 0, -1))
+          .normalisedCopy() * primaryBulletSpeed_;
+    speed += node_->getWorldSpeed();
+
+	  temp->setScale(Vector3(1, 1, 1) * 4);
+	  temp->yaw(Degree(-90));
+
+	  bulletManager_->addBullet(new Bullet(temp, bulletEntity, speed));
+
+    --leftAmmo_;
+  }
+
+
+  void BarrelGun::primaryFiring(unsigned int time)
+  {
+    if (time > 1000/primaryFiringRate_)
+    {
+      currentState_ = IDLE;
+    }
+  }
+
+
+
+  void BarrelGun::secondaryFire()
+  {
+    if (leftAmmo_ < 5)
+    {
+      currentState_ = IDLE;
+      return;
+    }
+
+    SceneNode *temp = sceneMgr_->getRootSceneNode()->createChildSceneNode(
+          node_->getSceneNode()->getWorldPosition(),
+          node_->getSceneNode()->getWorldOrientation());
+
+    Entity* bulletEntity = sceneMgr_->createEntity("BulletEntity"
+          + StringConverter::toString(bulletCounter_++), "Barrel.mesh");
+
+    Vector3 speed = (temp->getOrientation() * Vector3(0, 0, -1))
+          .normalisedCopy() * secondaryBulletSpeed_*0.5;
+    speed += node_->getWorldSpeed();
+
+	  temp->setScale(Vector3(1, 1, 1) * 10);
+	  temp->yaw(Degree(-90));
+
+	  bulletManager_->addBullet(new Bullet(temp, bulletEntity, speed));
+
+    leftAmmo_ -= 5;
+  }
+
+
+  void BarrelGun::secondaryFiring(unsigned int time)
+  {
+    if (time > 1000/secondaryFiringRate_)
+      currentState_ = IDLE;
+  }
+
+}
+}
Index: code/branches/main_reto_vs05/src/weapon/barrel_gun.h
===================================================================
--- code/branches/main_reto_vs05/src/weapon/barrel_gun.h	(revision 232)
+++ code/branches/main_reto_vs05/src/weapon/barrel_gun.h	(revision 232)
@@ -0,0 +1,65 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *
+ *
+ *   License notice:
+ *
+ *   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 3 of the License, or
+ *   (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+
+#ifndef BARREL_GUN_H
+#define BARREL_GUN_H
+
+#include "OgrePrerequisites.h"
+
+#include "orxonox_prerequisites.h"
+
+
+namespace orxonox {
+namespace weapon {
+
+  class BarrelGun : public BaseWeapon
+  {
+ public:
+    BarrelGun(InertialNode*, AmmunitionDump*);
+	  virtual ~BarrelGun();
+
+    bool tick(unsigned long, Ogre::Real);
+
+  protected:
+    void primaryFire();
+
+    void primaryFiring(unsigned int);
+
+    void secondaryFire();
+
+    void secondaryFiring(unsigned int);
+
+  public:
+
+  protected:
+
+  };
+}
+}
+
+#endif /* BARREL_GUN_H */
Index: code/branches/main_reto_vs05/src/weapon/base_weapon.cpp
===================================================================
--- code/branches/main_reto_vs05/src/weapon/base_weapon.cpp	(revision 198)
+++ code/branches/main_reto_vs05/src/weapon/base_weapon.cpp	(revision 232)
@@ -37,4 +37,5 @@
 #include "inertial_node.h"
 #include "ammunition_dump.h"
+#include "run_manager.h"
 
 #include "base_weapon.h"
@@ -45,16 +46,14 @@
   using namespace Ogre;
 
-  BaseWeapon::BaseWeapon(SceneManager *sceneMgr, InertialNode *node,
-        BulletManager *bulletManager, AmmunitionDump *ammoDump)
-        : sceneMgr_(sceneMgr), node_(node),
-        bulletCounter_(0), primaryFireRequest_(false), currentState_(IDLE),
-        secondaryFireRequest_(false),
-        bulletManager_(bulletManager), secondaryFired_(false),
-        timeSinceNextActionAdded_(0), actionAdded_(false), nextAction_(NOTHING),
-        name_("Base Weapon"), primaryFirePower_(100), secondaryFirePower_(500),
-        primaryFiringRate_(10), secondaryFiringRate_(2), primaryBulletSpeed_(1000),
-        secondaryBulletSpeed_(500), magazineSize_(25), ammoDump_(ammoDump)
+  BaseWeapon::BaseWeapon(InertialNode *node, AmmunitionDump *ammoDump)
+    : sceneMgr_(RunManager::getSingletonPtr()->getSceneManagerPtr()), node_(node),
+      bulletCounter_(0), primaryFireRequest_(false), currentState_(IDLE),
+      secondaryFireRequest_(false),
+      bulletManager_(RunManager::getSingletonPtr()->getBulletManagerPtr()),
+      secondaryFired_(false),
+      timeSinceNextActionAdded_(0), actionAdded_(false), nextAction_(NOTHING),
+      ammoDump_(ammoDump)
   {
-    leftAmmo_ = ammoDump_->getAmmunition(magazineSize_);
+    leftAmmo_ = 0;
   }
 
@@ -84,79 +83,7 @@
 
 
-  void BaseWeapon::primaryFire()
-  {
-    if (leftAmmo_ < 1)
-    {
-      currentState_ = IDLE;
-      return;
-    }
-
-    SceneNode *temp = sceneMgr_->getRootSceneNode()->createChildSceneNode(
-          node_->getSceneNode()->getWorldPosition(),
-          node_->getSceneNode()->getWorldOrientation());
-
-    Entity* bulletEntity = sceneMgr_->createEntity("BulletEntity"
-          + StringConverter::toString(bulletCounter_++), "Barrel.mesh");
-
-    Vector3 speed = (temp->getOrientation() * Vector3(0, 0, -1))
-          .normalisedCopy() * primaryBulletSpeed_;
-    speed += node_->getWorldSpeed();
-
-	  temp->setScale(Vector3(1, 1, 1) * 4);
-	  temp->yaw(Degree(-90));
-
-	  bulletManager_->addBullet(new Bullet(temp, bulletEntity, speed));
-
-    --leftAmmo_;
-  }
-
-
-  void BaseWeapon::primaryFiring(unsigned int time)
-  {
-    if (time > 100)
-    {
-      currentState_ = IDLE;
-    }
-  }
-
-
   void BaseWeapon::secondaryFireRequest()
   {
     secondaryFireRequest_ = true;
-  }
-
-
-  void BaseWeapon::secondaryFire()
-  {
-    if (leftAmmo_ < 5)
-    {
-      currentState_ = IDLE;
-      return;
-    }
-
-    SceneNode *temp = sceneMgr_->getRootSceneNode()->createChildSceneNode(
-          node_->getSceneNode()->getWorldPosition(),
-          node_->getSceneNode()->getWorldOrientation());
-
-    Entity* bulletEntity = sceneMgr_->createEntity("BulletEntity"
-          + StringConverter::toString(bulletCounter_++), "Barrel.mesh");
-
-    Vector3 speed = (temp->getOrientation() * Vector3(0, 0, -1))
-          .normalisedCopy() * secondaryBulletSpeed_*0.5;
-    speed += node_->getWorldSpeed();
-
-	  temp->setScale(Vector3(1, 1, 1) * 10);
-	  temp->yaw(Degree(-90));
-
-	  bulletManager_->addBullet(new Bullet(temp, bulletEntity, speed));
-
-    leftAmmo_ -= 5;
-  }
-
-
-  void BaseWeapon::secondaryFiring(unsigned int time)
-  {
-    if (time > 250)
-      currentState_ = IDLE;
   }
 
@@ -181,5 +108,5 @@
         {
         case RELOAD:
-          leftAmmo_ += ammoDump_->getAmmunition(magazineSize_ - leftAmmo_);
+          leftAmmo_ += ammoDump_->getAmmunition("Barrel", magazineSize_ - leftAmmo_);
           break;
 
Index: code/branches/main_reto_vs05/src/weapon/base_weapon.h
===================================================================
--- code/branches/main_reto_vs05/src/weapon/base_weapon.h	(revision 198)
+++ code/branches/main_reto_vs05/src/weapon/base_weapon.h	(revision 232)
@@ -58,6 +58,5 @@
 
   public:
-    BaseWeapon(Ogre::SceneManager*, InertialNode*, BulletManager*,
-          AmmunitionDump*);
+    BaseWeapon(InertialNode*, AmmunitionDump*);
 	  virtual ~BaseWeapon();
 
@@ -73,11 +72,11 @@
 
   protected:
-    void primaryFire();
+    virtual void primaryFire() = 0;
 
-    void primaryFiring(unsigned int);
+    virtual void primaryFiring(unsigned int) = 0;
 
-    void secondaryFire();
+    virtual void secondaryFire() = 0;
 
-    void secondaryFiring(unsigned int);
+    virtual void secondaryFiring(unsigned int) = 0;
 
   public:
