Index: code/branches/merger/src/CMakeLists.txt
===================================================================
--- code/branches/merger/src/CMakeLists.txt	(revision 299)
+++ code/branches/merger/src/CMakeLists.txt	(revision 300)
@@ -1,12 +1,3 @@
 PROJECT(Orxonox)
-
-# create a few variables to simplify life
-# SET(SRC_FILES orxonox/orxonox.cc loader/LevelLoader.cc xml/xmlParser.cc orxonox/core/IdentifierList.cc orxonox/core/Identifier.cc orxonox/core/MetaObjectList.cc orxonox/core/Factory.cc orxonox/core/OrxonoxClass.cc orxonox/objects/BaseObject.cc orxonox/objects/test1.cc orxonox/objects/test2.cc orxonox/objects/test3.cc)
-# SET(INC_FILES loader/LevelLoader.h xml/xmlParser.h orxonox/core/IdentifierIncludes.h orxonox/core/Identifier.h orxonox/core/Factory.h orxonox/core/ClassFactory.h orxonox/core/IdentifierList.h orxonox/core/ObjectList.h orxonox/core/MetaObjectList.h orxonox/core/Iterator.h orxonox/core/OrxonoxClass.h orxonox/objects/BaseObject.h orxonox/objects/Test.h orxonox/objects/test1.h orxonox/objects/test2.h orxonox/objects/test3.h)
-
-#Creates an executable
-# ADD_EXECUTABLE(../bin/main ${SRC_FILES} ${INC_FILES})
-#Links the executable against OGRE and OIS
-# TARGET_LINK_LIBRARIES(../bin/main ${OGRE_LIBRARIES} ${OIS_LIBRARIES} ${CEGUI_LIBRARIES} ${CEGUI_OGRE_LIBRARIES})
 
 ADD_SUBDIRECTORY(orxonox)
@@ -14,2 +5,34 @@
 ADD_SUBDIRECTORY(network)
 ADD_SUBDIRECTORY(hud)
+ADD_SUBDIRECTORY(weapon)
+ADD_SUBDIRECTORY(class_hierarchy)
+
+
+# create a few variables to simplify life
+# SET( ORXONOX_SRC
+# 	inertial_node.cc
+# 	main.cc
+# 	ogre_control.cc
+# 	orxonox.cc
+# 	orxonox_scene.cc
+# 	orxonox_ship.cc
+# 	run_manager.cc
+# )
+
+#Creates an executable
+# ADD_EXECUTABLE(../bin/main ${ORXONOX_SRC} )
+
+#add weapon source dir
+
+# ADD_SUBDIRECTORY(hud)
+
+#Links the executable against OGRE and OIS
+# TARGET_LINK_LIBRARIES(../bin/main
+# 	WEAPON
+# 	CLASS_HIERARCHY
+# 	HUD
+# 	${OGRE_LIBRARIES} ${OIS_LIBRARIES} ${CEGUI_LIBRARIES} ${CEGUI_OGRE_LIBRARIES}
+# )
+
+#TARGET_LINK_LIBRARIES(../bin/main ${OGRE_LIBRARIES} ${OIS_LIBRARIES} ${CEGUI_LIBRARIES} ${CEGUI_OGRE_LIBRARIES})
+
Index: code/branches/merger/src/class_hierarchy/BaseObject.cc
===================================================================
--- code/branches/merger/src/class_hierarchy/BaseObject.cc	(revision 300)
+++ code/branches/merger/src/class_hierarchy/BaseObject.cc	(revision 300)
@@ -0,0 +1,14 @@
+#include "BaseObject.h"
+
+namespace orxonox
+{
+    BaseObject::BaseObject()
+    {
+        registerRootObject(BaseObject);
+    }
+
+    BaseObject::~BaseObject()
+    {
+        unregisterObject();
+    }
+}
Index: code/branches/merger/src/class_hierarchy/BaseObject.h
===================================================================
--- code/branches/merger/src/class_hierarchy/BaseObject.h	(revision 300)
+++ code/branches/merger/src/class_hierarchy/BaseObject.h	(revision 300)
@@ -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/merger/src/class_hierarchy/CMakeLists.txt
===================================================================
--- code/branches/merger/src/class_hierarchy/CMakeLists.txt	(revision 300)
+++ code/branches/merger/src/class_hierarchy/CMakeLists.txt	(revision 300)
@@ -0,0 +1,17 @@
+PROJECT(Orxonox)
+
+# create a few variables to simplify life
+SET( CLASS_HIERARCHY_SRC
+	BaseObject.cc
+	ClassHierarchy.cc
+	Identifier.cc
+	IdentifierList.cc
+	ObjectList.cc
+	orxonox.cc
+	OrxonoxClass.cc
+	test1.cc
+	test2.cc
+	test3.cc
+   )
+
+ADD_LIBRARY(CLASS_HIERARCHY ${CLASS_HIERARCHY_SRC} )
Index: code/branches/merger/src/class_hierarchy/ClassHierarchy.cc
===================================================================
--- code/branches/merger/src/class_hierarchy/ClassHierarchy.cc	(revision 300)
+++ code/branches/merger/src/class_hierarchy/ClassHierarchy.cc	(revision 300)
@@ -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/merger/src/class_hierarchy/ClassHierarchy.h
===================================================================
--- code/branches/merger/src/class_hierarchy/ClassHierarchy.h	(revision 300)
+++ code/branches/merger/src/class_hierarchy/ClassHierarchy.h	(revision 300)
@@ -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/merger/src/class_hierarchy/Identifier.cc
===================================================================
--- code/branches/merger/src/class_hierarchy/Identifier.cc	(revision 300)
+++ code/branches/merger/src/class_hierarchy/Identifier.cc	(revision 300)
@@ -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/merger/src/class_hierarchy/Identifier.h
===================================================================
--- code/branches/merger/src/class_hierarchy/Identifier.h	(revision 300)
+++ code/branches/merger/src/class_hierarchy/Identifier.h	(revision 300)
@@ -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/merger/src/class_hierarchy/IdentifierIncludes.h
===================================================================
--- code/branches/merger/src/class_hierarchy/IdentifierIncludes.h	(revision 300)
+++ code/branches/merger/src/class_hierarchy/IdentifierIncludes.h	(revision 300)
@@ -0,0 +1,5 @@
+#include "ClassHierarchy.h"
+#include "Identifier.h"
+#include "IdentifierList.h"
+#include "ObjectList.h"
+#include "OrxonoxClass.h"
Index: code/branches/merger/src/class_hierarchy/IdentifierList.cc
===================================================================
--- code/branches/merger/src/class_hierarchy/IdentifierList.cc	(revision 300)
+++ code/branches/merger/src/class_hierarchy/IdentifierList.cc	(revision 300)
@@ -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/merger/src/class_hierarchy/IdentifierList.h
===================================================================
--- code/branches/merger/src/class_hierarchy/IdentifierList.h	(revision 300)
+++ code/branches/merger/src/class_hierarchy/IdentifierList.h	(revision 300)
@@ -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/merger/src/class_hierarchy/ObjectList.cc
===================================================================
--- code/branches/merger/src/class_hierarchy/ObjectList.cc	(revision 300)
+++ code/branches/merger/src/class_hierarchy/ObjectList.cc	(revision 300)
@@ -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/merger/src/class_hierarchy/ObjectList.h
===================================================================
--- code/branches/merger/src/class_hierarchy/ObjectList.h	(revision 300)
+++ code/branches/merger/src/class_hierarchy/ObjectList.h	(revision 300)
@@ -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/merger/src/class_hierarchy/OrxonoxClass.cc
===================================================================
--- code/branches/merger/src/class_hierarchy/OrxonoxClass.cc	(revision 300)
+++ code/branches/merger/src/class_hierarchy/OrxonoxClass.cc	(revision 300)
@@ -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/merger/src/class_hierarchy/OrxonoxClass.h
===================================================================
--- code/branches/merger/src/class_hierarchy/OrxonoxClass.h	(revision 300)
+++ code/branches/merger/src/class_hierarchy/OrxonoxClass.h	(revision 300)
@@ -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/merger/src/class_hierarchy/Test.h
===================================================================
--- code/branches/merger/src/class_hierarchy/Test.h	(revision 300)
+++ code/branches/merger/src/class_hierarchy/Test.h	(revision 300)
@@ -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/merger/src/class_hierarchy/orxonox.cc
===================================================================
--- code/branches/merger/src/class_hierarchy/orxonox.cc	(revision 300)
+++ code/branches/merger/src/class_hierarchy/orxonox.cc	(revision 300)
@@ -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/merger/src/class_hierarchy/test1.cc
===================================================================
--- code/branches/merger/src/class_hierarchy/test1.cc	(revision 300)
+++ code/branches/merger/src/class_hierarchy/test1.cc	(revision 300)
@@ -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/merger/src/class_hierarchy/test1.h
===================================================================
--- code/branches/merger/src/class_hierarchy/test1.h	(revision 300)
+++ code/branches/merger/src/class_hierarchy/test1.h	(revision 300)
@@ -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/merger/src/class_hierarchy/test2.cc
===================================================================
--- code/branches/merger/src/class_hierarchy/test2.cc	(revision 300)
+++ code/branches/merger/src/class_hierarchy/test2.cc	(revision 300)
@@ -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/merger/src/class_hierarchy/test2.h
===================================================================
--- code/branches/merger/src/class_hierarchy/test2.h	(revision 300)
+++ code/branches/merger/src/class_hierarchy/test2.h	(revision 300)
@@ -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/merger/src/class_hierarchy/test3.cc
===================================================================
--- code/branches/merger/src/class_hierarchy/test3.cc	(revision 300)
+++ code/branches/merger/src/class_hierarchy/test3.cc	(revision 300)
@@ -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/merger/src/class_hierarchy/test3.h
===================================================================
--- code/branches/merger/src/class_hierarchy/test3.h	(revision 300)
+++ code/branches/merger/src/class_hierarchy/test3.h	(revision 300)
@@ -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/merger/src/hud/hud_overlay.h
===================================================================
--- code/branches/merger/src/hud/hud_overlay.h	(revision 299)
+++ code/branches/merger/src/hud/hud_overlay.h	(revision 300)
@@ -33,4 +33,6 @@
 #include "OgrePrerequisites.h"
 
+#include "orxonox_prerequisites.h"
+
 
 namespace orxonox {
Index: code/branches/merger/src/hud/test_overlay.cc
===================================================================
--- code/branches/merger/src/hud/test_overlay.cc	(revision 300)
+++ code/branches/merger/src/hud/test_overlay.cc	(revision 300)
@@ -0,0 +1,124 @@
+/*
+ *   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:
+ *      HUD design: Yuning Chai
+ *      Implementation: Yuning Chai
+ *   Co-authors:
+ *      Implementation: Reto Grieder
+ *
+ */
+
+//#include "OgreMath.h"
+//#include "OgreVector3.h"
+#include "OgreStringConverter.h"
+#include "OgreOverlayManager.h"
+#include "OgreOverlay.h"
+#include "OgreOverlayElement.h"
+#include "OgreRenderWindow.h"
+#include "OgreRenderTarget.h"
+
+#include "test_overlay.h"
+
+
+namespace orxonox {
+namespace hud {
+  using namespace Ogre;
+
+  TestOverlay::TestOverlay(RenderWindow *window)
+    :window_(window)
+  {
+    //TODO: write safe guard
+    overlay_ = OverlayManager::getSingleton().getByName("Core/DebugOverlay");
+  }
+
+
+  TestOverlay::~TestOverlay()
+  {
+  }
+
+
+  void TestOverlay::show()
+  {
+    //TODO: safe guard
+    overlay_->show();
+  }
+
+
+  void TestOverlay::hide()
+  {
+    //TODO: safe guard
+    overlay_->hide();
+  }
+
+
+  void TestOverlay::setDebugText(Ogre::String &str)
+  {
+    debugText_ = str;
+  }
+
+
+  bool TestOverlay::tick(unsigned long, Ogre::Real)
+  {
+    static String currFps = "Current FPS: ";
+    static String avgFps = "Average FPS: ";
+    static String bestFps = "Best FPS: ";
+    static String worstFps = "Worst FPS: ";
+    static String tris = "Triangle Count: ";
+    static String batches = "Batch Count: ";
+
+    // update stats when necessary
+    try {
+      OverlayElement* guiAvg = OverlayManager::getSingleton()
+        .getOverlayElement("Core/AverageFps");
+      OverlayElement* guiCurr = OverlayManager::getSingleton()
+        .getOverlayElement("Core/CurrFps");
+      OverlayElement* guiBest = OverlayManager::getSingleton()
+        .getOverlayElement("Core/BestFps");
+      OverlayElement* guiWorst = OverlayManager::getSingleton()
+        .getOverlayElement("Core/WorstFps");
+
+      const RenderTarget::FrameStats& stats = window_->getStatistics();
+      guiAvg->setCaption(avgFps + StringConverter::toString(stats.avgFPS));
+      guiCurr->setCaption(currFps + StringConverter::toString(stats.lastFPS));
+      guiBest->setCaption(bestFps + StringConverter::toString(stats.bestFPS)
+        +" "+StringConverter::toString(stats.bestFrameTime)+" ms");
+      guiWorst->setCaption(worstFps + StringConverter::toString(stats.worstFPS)
+        +" "+StringConverter::toString(stats.worstFrameTime)+" ms");
+
+      OverlayElement* guiTris = OverlayManager::getSingleton()
+        .getOverlayElement("Core/NumTris");
+      guiTris->setCaption(tris + StringConverter::toString(stats.triangleCount));
+
+      OverlayElement* guiBatches = OverlayManager::getSingleton()
+        .getOverlayElement("Core/NumBatches");
+      guiBatches->setCaption(batches
+        + StringConverter::toString(stats.batchCount));
+
+      OverlayElement* guiDbg = OverlayManager::getSingleton()
+        .getOverlayElement("Core/DebugText");
+      guiDbg->setCaption(debugText_);
+    }
+    catch(...) { /* ignore */ }
+
+    return true;
+  }
+}
+}
Index: code/branches/merger/src/hud/test_overlay.h
===================================================================
--- code/branches/merger/src/hud/test_overlay.h	(revision 300)
+++ code/branches/merger/src/hud/test_overlay.h	(revision 300)
@@ -0,0 +1,69 @@
+/*
+ *   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:
+ *      HUD design: Yuning Chai
+ *      Implementation: Yuning Chai
+ *   Co-authors:
+ *      Implementation: Reto Grieder
+ *
+ */
+
+
+#ifndef TEST_OVERLAY_H
+#define TEST_OVERLAY_H
+
+#include "OgrePrerequisites.h"
+
+#include "orxonox_prerequisites.h"
+
+
+namespace orxonox {
+namespace hud {
+
+  class TestOverlay
+  {
+  public:
+    TestOverlay(Ogre::RenderWindow*);
+	  virtual ~TestOverlay();
+
+    void show();
+
+    void hide();
+
+    void setDebugText(Ogre::String&);
+
+    bool tick(unsigned long, Ogre::Real);
+
+  protected:
+
+  public:
+
+  protected:
+    Ogre::Overlay *overlay_;
+    Ogre::RenderWindow *window_;
+
+    Ogre::String debugText_;
+
+  };
+}
+}
+
+#endif /* TEST_OVERLAY_H */
Index: code/branches/merger/src/inertial_node.cc
===================================================================
--- code/branches/merger/src/inertial_node.cc	(revision 300)
+++ code/branches/merger/src/inertial_node.cc	(revision 300)
@@ -0,0 +1,126 @@
+/*
+ *   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 "OgreSceneNode.h"
+#include "OgreVector3.h"
+
+#include "inertial_node.h"
+
+
+namespace orxonox {
+  using namespace Ogre;
+
+  InertialNode::InertialNode(SceneNode *node, Vector3 speed)
+        : node_(node), speed_(speed), childListSize_(4), childListIndex_(0),
+        parentNode_(NULL)
+  {
+    childList_ = new InertialNode*[childListSize_];
+  }
+
+
+  InertialNode::InertialNode(orxonox::InertialNode *parentNode, Vector3 speed)
+        : parentNode_(parentNode), childListSize_(4), childListIndex_(0), speed_(speed)
+  {
+    childList_ = new InertialNode*[childListSize_];
+    node_ = parentNode_->getSceneNode()->createChildSceneNode();
+  }
+
+
+  InertialNode::~InertialNode()
+  {
+    if (childList_)
+    {
+      for (int i = 0; i < childListIndex_; i++)
+        if (childList_[i])
+          delete childList_[i];
+      delete childList_;
+    }
+  }
+
+
+  InertialNode* InertialNode::createChildNode()
+  {
+    InertialNode *temp = new InertialNode(this);
+    addChild(temp);
+    return temp;
+  }
+
+
+  InertialNode* InertialNode::getParentNode()
+  {
+    return parentNode_;
+  }
+
+
+  SceneNode* InertialNode::getSceneNode()
+  {
+    return node_;
+  }
+
+
+  Vector3 InertialNode::getSpeed()
+  {
+    return speed_;
+  }
+
+
+  Vector3 InertialNode::getWorldSpeed()
+  {
+    // go through the tree of Inertial nodes
+    Vector3 speed = speed_;
+    InertialNode *temp = parentNode_;
+    while (temp != NULL)
+    {
+      speed = temp->getSceneNode()->getOrientation() * speed + temp->getSpeed();
+      temp = temp->getParentNode();
+    }
+    return speed;
+  }
+
+
+  void InertialNode::addSpeed(Vector3 speed)
+  {
+    speed_ += speed;
+  }
+
+
+  void InertialNode::addChild(orxonox::InertialNode *node)
+  {
+    if (childListIndex_ == childListSize_)
+    {
+      // redimension the array
+      InertialNode **tempArray = new InertialNode*[2*childListSize_];
+      for (int i = 0; i < childListSize_; i++)
+        tempArray[i] = childList_[i];
+      childListSize_ *= 2;
+      delete childList_;
+      childList_ = tempArray;
+    }
+    childList_[childListIndex_++] = node;
+  }
+
+}
Index: code/branches/merger/src/inertial_node.h
===================================================================
--- code/branches/merger/src/inertial_node.h	(revision 300)
+++ code/branches/merger/src/inertial_node.h	(revision 300)
@@ -0,0 +1,77 @@
+/*
+ *   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 INERTIAL_NODE_H
+#define INERTIAL_NODE_H
+
+#include "OgrePrerequisites.h"
+
+#include "orxonox_prerequisites.h"
+
+
+namespace orxonox {
+
+  class InertialNode
+  {
+  public:
+    InertialNode(Ogre::SceneNode*, Ogre::Vector3);
+	  ~InertialNode();
+
+    InertialNode* createChildNode();
+
+    InertialNode* getParentNode();
+
+    Ogre::SceneNode* getSceneNode();
+
+    Ogre::Vector3 getSpeed();
+
+    Ogre::Vector3 getWorldSpeed();
+
+    void addSpeed(Ogre::Vector3);
+
+  protected:
+    InertialNode(InertialNode*, Ogre::Vector3 speed = Ogre::Vector3::ZERO);
+    void addChild(InertialNode*);
+
+  public:
+
+  protected:
+    InertialNode **childList_;
+    int childListSize_;
+    int childListIndex_;
+
+    Ogre::SceneNode *node_;
+	  Ogre::Vector3 speed_;
+
+    InertialNode* parentNode_;
+
+  };
+
+}
+
+#endif /* INERTIAL_NODE_H */
Index: code/branches/merger/src/main.cc
===================================================================
--- code/branches/merger/src/main.cc	(revision 300)
+++ code/branches/merger/src/main.cc	(revision 300)
@@ -0,0 +1,124 @@
+/*
+ *   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:
+ *      ...
+ *
+ */
+
+//#define WITH_HIERARCHY
+
+#include "OgrePlatform.h"
+#include "OgreException.h"
+
+#include "orxonox.h"
+
+#ifdef WITH_HIERARCHY
+#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"
+#endif
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if 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 
+  {
+#ifndef WITH_HIERARCHY
+    try {
+      // create an orxonox application and run it
+      orxonox::Orxonox myApp;
+
+      myApp.go();
+    }
+    catch (Ogre::Exception& e) {
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32 
+      MessageBoxA(NULL, e.getFullDescription().c_str(),
+            "An exception has occured!", MB_OK | MB_ICONERROR | MB_TASKMODAL);
+#else
+      std::cerr << "Exception:\n";
+      std::cerr << e.getFullDescription().c_str() << "\n";
+#endif
+      return 1;
+    }
+
+#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;
+  }
+
+#ifdef __cplusplus
+}
+#endif
Index: code/branches/merger/src/ogre_control.cc
===================================================================
--- code/branches/merger/src/ogre_control.cc	(revision 300)
+++ code/branches/merger/src/ogre_control.cc	(revision 300)
@@ -0,0 +1,223 @@
+/*
+ *   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 "OgrePlatform.h"
+#include "OgreRoot.h"
+#include "OgreRenderWindow.h"
+#include "OgreString.h"
+#include "OgreConfigFile.h"
+
+#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
+  #include <CoreFoundation/CoreFoundation.h>
+#endif
+
+#include "ogre_control.h"
+
+
+namespace orxonox {
+  using namespace Ogre;
+
+  /**
+  * Ogre control class.
+  * This is merely a convenient way to handle Ogre. It only holds the Root
+  * object and the render Window. These are the objects, that are independant
+  * of the game state (playing, menu browsing, loading, etc.).
+  * This class could easily be merged into the Orxnox class.
+  */
+
+
+  /**
+  * Provide support for mac users.
+  */
+  #if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
+  // 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
+
+
+  /**
+  * Constructor that determines the resource path platform dependant.
+  */
+  OgreControl::OgreControl() : root_(0)
+  {
+	  // Provide a nice cross platform solution for locating the configuration
+	  // files. On windows files are searched for in the current working
+    // directory, on OS X however you must provide the full path, the helper
+    // function macBundlePath does this for us.
+  #if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
+	  resourcePath_ = macBundlePath() + "/Contents/Resources/";
+  #else
+	  resourcePath_ = "";
+  #endif
+  }
+
+
+  /**
+  * Standard Destructor.
+  */
+  OgreControl::~OgreControl()
+  {
+	  if (root_)
+		  delete root_;
+  }
+
+
+  /* Sets up Ogre.
+  * First, the Root object is being created, then the resources are defined
+  * (not loaded!). And last but not least, the render settings (like resolution
+  * or AA level) are prompted to the user.
+  */
+  bool OgreControl::initialise(void)
+  {
+	  String pluginsPath;
+	  // only use plugins.cfg if not static
+  #ifndef OGRE_STATIC_LIB
+	  pluginsPath = resourcePath_ + "plugins.cfg";
+  #endif
+
+	  root_ = new Root(pluginsPath, 
+		  resourcePath_ + "ogre.cfg", resourcePath_ + "Ogre.log");
+
+	  setupResources();
+
+	  if (!configure())
+		  return false;
+
+	  return true;
+  }
+
+
+  /**
+  * Defines the source of the resources.
+  */
+  void OgreControl::setupResources(void)
+  {
+	  // Load resource paths from config file
+	  ConfigFile cf;
+	  cf.load(resourcePath_ + "resources.cfg");
+
+	  // Go through all sections & settings in the file
+	  ConfigFile::SectionIterator seci = cf.getSectionIterator();
+
+	  String secName, typeName, archName;
+	  while (seci.hasMoreElements())
+	  {
+		  secName = seci.peekNextKey();
+		  ConfigFile::SettingsMultiMap *settings = seci.getNext();
+		  ConfigFile::SettingsMultiMap::iterator i;
+		  for (i = settings->begin(); i != settings->end(); ++i)
+		  {
+			  typeName = i->first;
+			  archName = i->second;
+  #if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
+			  // OS X does not set the working directory relative to the app,
+			  // In order to make things portable on OS X we need to provide
+			  // the loading with it's own bundle path location
+			  ResourceGroupManager::getSingleton().addResourceLocation(
+				  String(macBundlePath() + "/" + archName), typeName, secName);
+  #else
+			  ResourceGroupManager::getSingleton().addResourceLocation(
+				  archName, typeName, secName);
+  #endif
+		  }
+	  }
+  }
+
+
+  /**
+  * Prompts a setting window for the render engine if that has not already
+  * been done.
+  * The method also calls the root initialiser in order to get a render window.
+  */
+  bool OgreControl::configure(void)
+  {
+	  // Show the configuration dialog and initialise the system
+	  // You can skip this and use root.restoreConfig() to load configuration
+	  // settings if you were sure there are valid ones saved in ogre.cfg
+	  if(!root_->restoreConfig() && !root_->showConfigDialog())
+		  return false;
+
+	  // user clicked OK so initialise
+	  // Here we choose to let the system create a default
+    // rendering window by passing 'true'
+	  root_->saveConfig();
+	  window_ = root_->initialise(true);
+	  return true;
+  }
+
+
+  /**
+  * Returns the root object.
+  * @return Root object.
+  */
+  Root* OgreControl::getRoot(void)
+  {
+	  return root_;
+  }
+
+
+  /**
+  * Returns the render window.
+  * @return Render window.
+  */
+  RenderWindow* OgreControl::getRenderWindow(void)
+  {
+	  return window_;
+  }
+
+
+  /**
+  * Returns the resource path.
+  * @return Resource path.
+  */
+  Ogre::String OgreControl::getResourcePath(void)
+  {
+	  return resourcePath_;
+  }
+
+}
Index: code/branches/merger/src/ogre_control.h
===================================================================
--- code/branches/merger/src/ogre_control.h	(revision 300)
+++ code/branches/merger/src/ogre_control.h	(revision 300)
@@ -0,0 +1,71 @@
+/*
+ *   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 OGRE_CONTROL_H
+#define OGRE_CONTROL_H
+
+#include "OgrePrerequisites.h"
+
+#include "orxonox_prerequisites.h"
+
+
+namespace orxonox {
+
+  class OgreControl
+  {
+  public:
+	  OgreControl();
+
+	  virtual ~OgreControl();
+
+	  /** Sets up the application - returns false if the user chooses to abandon configuration. */
+	  virtual bool initialise();
+
+    virtual Ogre::Root* getRoot();
+
+	  virtual Ogre::RenderWindow* getRenderWindow();
+
+	  virtual Ogre::String getResourcePath();
+
+  protected:
+	  /** Configures the application - returns false if the user chooses to abandon configuration. */
+	  virtual bool configure(void);
+
+	  /// Method which will define the source of resources (other than current folder)
+	  virtual void setupResources(void);
+
+  protected:
+	  Ogre::Root         *root_;
+	  Ogre::RenderWindow *window_;
+	  Ogre::String  resourcePath_;
+
+  };
+
+}
+
+#endif /* OGRE_CONTROL_H */
Index: code/branches/merger/src/orxonox.h
===================================================================
--- code/branches/merger/src/orxonox.h	(revision 300)
+++ code/branches/merger/src/orxonox.h	(revision 300)
@@ -0,0 +1,59 @@
+/*
+ *   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 ORXONOX_H
+#define ORXONOX_H
+
+#include "OgrePrerequisites.h"
+
+#include "orxonox_prerequisites.h"
+
+namespace orxonox {
+
+  class Orxonox
+  {
+  public:
+    Orxonox();
+    virtual ~Orxonox();
+	  virtual void go();
+
+  protected:
+	  virtual bool setup(void);
+
+	  virtual void destroy(void);
+
+  protected:
+	  OgreControl *ogre_;
+	  RunManager  *runMgr_;
+	  Ogre::Timer *timer_;
+
+  };
+
+}
+
+#endif /* ORXONOX_H */
Index: code/branches/merger/src/orxonox_prerequisites.h
===================================================================
--- code/branches/merger/src/orxonox_prerequisites.h	(revision 300)
+++ code/branches/merger/src/orxonox_prerequisites.h	(revision 300)
@@ -0,0 +1,64 @@
+/*
+ *   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 ORXONOX_PREREQUISITES_H
+#define ORXONOX_PREREQUISITES_H
+
+namespace orxonox {
+
+  class CameraManager;
+  class InertialNode;
+  class OgreControl;
+  class Orxonox;
+  class OrxonoxShip;
+  class OrxonoxScene;
+  class RunManager;
+
+
+  namespace weapon {
+
+    class AmmunitionDump;
+    class Bullet;
+    class BulletManager;
+    class BaseWeapon;
+    class BarrelGun;
+    class WeaponStation;
+
+  }
+
+
+  namespace hud {
+    
+    class HUDOverlay;
+    class TestOverlay;
+
+  }
+
+}
+
+#endif /* ORXONOX_PREREQUISITES_H */
Index: code/branches/merger/src/orxonox_scene.cc
===================================================================
--- code/branches/merger/src/orxonox_scene.cc	(revision 300)
+++ code/branches/merger/src/orxonox_scene.cc	(revision 300)
@@ -0,0 +1,155 @@
+/*
+ *   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 "OgreSceneManager.h"
+#include "OgreSceneNode.h"
+#include "OgreEntity.h"
+#include "OgreLight.h"
+#include "OgreBillboard.h"
+#include "OgreBillboardSet.h"
+#include "OgreVector3.h"
+
+#include "orxonox_scene.h"
+
+namespace orxonox {
+  using namespace Ogre;
+
+  /**
+  * The orxonox scene includes everything running in the background like terrain,
+  * static figures, dangling lamp, etc.
+  */
+
+
+  /**
+  * Empty Consructor except the initialiser list.
+  * @param sceneMgr The Scene Manager.
+  */
+  OrxonoxScene::OrxonoxScene(SceneManager *sceneMgr) : sceneMgr_(sceneMgr)
+  {
+  }
+
+  /**
+  * Empty Destructor.
+  */
+  OrxonoxScene::~OrxonoxScene()
+  {
+  }
+
+  /**
+  * Ogre initialisation method.
+  * This function is called by the Run Manager to load the neccessary recources
+  * and to create the scene.
+  * @return False if failed.
+  */
+  bool OrxonoxScene::initialise()
+  {
+	  // Load resources
+	  loadResources();
+
+	  distance_ = 0;
+	  radius_ = 100;
+
+	  createScene();
+
+	  return true;
+  }
+
+
+  /**
+  * Resource loader.
+  * Currently, this method loads everything! TODO: If done this ugly, it should
+  * at least be in the Run Manager.
+  */
+  void OrxonoxScene::loadResources()
+  {
+	  // Initialise, parse scripts etc
+	  ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
+  }
+
+
+  /**
+  * Scene creation.
+  * Currently just a test scene with an ogre head an a surrounding light.
+  */
+  void OrxonoxScene::createScene()
+  {
+	  sceneMgr_->setAmbientLight(ColourValue(0.3,0.3,0.3)*2);
+
+	  //create first entity
+	  Entity *head = sceneMgr_->createEntity("head", "ogrehead.mesh");
+
+	  //create a scene node to attach the head to
+	  SceneNode *node = sceneMgr_->getRootSceneNode()
+          ->createChildSceneNode("OgreHeadNode", Vector3(0,0,0));
+	  //attach the ogre head
+	  node->attachObject(head);
+
+	  // set up skybox
+	  sceneMgr_->setSkyBox(true, "Examples/SceneSkyBox1");
+
+	  // set up one light_ source
+	  light_ = sceneMgr_->createLight("Light1");
+	  light_->setType(Light::LT_POINT);
+	  light_->setPosition(Vector3(0, 0, 0));
+	  light_->setDiffuseColour(1.0, 1.0, 1.0);
+	  light_->setSpecularColour(1.0, 1.0, 1.0);
+
+	  //create billboard
+	  bbs_ = sceneMgr_->createBillboardSet("bb", 1);
+	  bbs_->createBillboard(Vector3::ZERO, ColourValue(1.0, 1.0, 1.0));
+	  bbs_->setMaterialName("Examples/Flare");
+
+	  lightNode_ = sceneMgr_->getRootSceneNode()
+          ->createChildSceneNode("lightNode_", Vector3(0, 100, 0));
+
+	  lightNode_->attachObject(bbs_);
+	  lightNode_->attachObject(light_);
+  }
+
+
+  /**
+  * Compute something between frames if neccessary.
+  * @param time Absolute time.
+  * @param deltaTime Relative time.
+  * @return Return true to continue rendering.
+  */
+  bool OrxonoxScene::tick(unsigned long time, Real deltaTime)
+  {
+	  Real t = time/1000.0;
+
+	  lightNode_->setPosition(radius_*sin(5*t), radius_*cos(5*t), sin(1*t)*distance_);
+  	
+	  light_->setDiffuseColour(sin(1*t), sin(1*t + 2.09), sin(1*t + 2.09*2));
+	  light_->setSpecularColour(sin(1*t), sin(1*t + 2.09), sin(1*t + 2.09*2));
+
+	  bbs_->getBillboard(0)->setColour(ColourValue(sin(1*t),
+          sin(1*t + 2.09), sin(1*t + 2.09*2)));
+    
+    return true;
+  }
+
+}
Index: code/branches/merger/src/orxonox_scene.h
===================================================================
--- code/branches/merger/src/orxonox_scene.h	(revision 300)
+++ code/branches/merger/src/orxonox_scene.h	(revision 300)
@@ -0,0 +1,70 @@
+/*
+ *   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 ORXONOX_SCENE_H
+#define ORXONOX_SCENE_H
+
+#include "OgrePrerequisites.h"
+
+#include "orxonox_prerequisites.h"
+
+
+namespace orxonox {
+
+  class OrxonoxScene
+  {
+  public:
+    OrxonoxScene(Ogre::SceneManager*);
+
+	  virtual ~OrxonoxScene();
+
+	  virtual bool initialise();
+
+	  virtual bool tick(unsigned long, Ogre::Real);
+
+  protected:
+	  /// method where you can perform resource group loading
+	  virtual void loadResources();
+
+	  /// Define what is in the scene
+	  virtual void createScene();
+
+  protected:
+	  Ogre::SceneManager* sceneMgr_;
+
+	  //specific variables for test purposes
+	  Ogre::Light        *light_;
+	  Ogre::SceneNode    *lightNode_;
+	  Ogre::BillboardSet *bbs_;
+	  Ogre::Real distance_;
+    Ogre::Real radius_;
+  };
+
+}
+
+#endif /* ORXONOX_SCENE_H */
Index: code/branches/merger/src/orxonox_ship.cc
===================================================================
--- code/branches/merger/src/orxonox_ship.cc	(revision 300)
+++ code/branches/merger/src/orxonox_ship.cc	(revision 300)
@@ -0,0 +1,254 @@
+/*
+ *   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 "OgreQuaternion.h"
+#include "OgreSceneNode.h"
+#include "OgreEntity.h"
+#include "OgreSceneManager.h"
+#include "OgreParticleSystem.h"
+
+#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"
+
+#include "orxonox_ship.h"
+
+
+namespace orxonox {
+  using namespace Ogre;
+  using namespace weapon;
+
+  /**
+  * Base class for any kind of flyable ship in Orxonox.
+  * 
+  * The ship offers steering methods (like left, right, etc.) and translates
+  * them into movement. A ship can also hold more than one weapons (where each
+  * of these can be replaced during the game). This means that a ship can have
+  * many WeaponManagers but only one MunitionManager (independant object that
+  * is referenced in each WeaponManager).
+  * Furthermore a ship in Orxonox is responsible for its visualization, which is
+  * why it receives a pointer to the SceneManager.
+  */
+
+
+  /**
+  * Standard constructor, that only initalizes a few variables. Some of them
+  * could be made static, since any new ship would be derived from the BaseShip.
+  * Or even better: write config files for each ship so that manipulating
+  * its properties would be even easier.
+  * @param mSceneMgr The current main SceneManager
+  * @param mNode The scene node which the ship will be attached to later.
+  */
+  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);
+  }
+
+
+  /**
+  * Standard destructor.
+  * Doesn't have any work to do yet.
+  */
+  OrxonoxShip::~OrxonoxShip()
+  {
+    if (mainWeapon_)
+      delete mainWeapon_;
+    if (railGunStation_)
+      delete railGunStation_;
+    if (rootNode_)
+      delete rootNode_;
+  }
+
+
+  /**
+  * Initialises everything.
+  * Once that ResourceGroups are organised, this method loads them.
+  * It might be an idea to make this function static in order for the
+  * SceneManger to call the initialise method of every needed class (macros..)
+  * @return Returns false when failed.
+  */
+  bool OrxonoxShip::initialise()
+  {
+	  // load all the resources needed (no resource groups yet,
+    // so the allInit is not executed!)
+	  // ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
+
+	  // create the "space ship" (currently a fish..)
+	  // TODO: names must be unique! use static variables..
+	  shipEntity_ = sceneMgr_->createEntity("Ship", "fish.mesh");
+	  InertialNode *fishNode = rootNode_->createChildNode();
+    fishNode->getSceneNode()->yaw(Degree(-90));
+	  fishNode->getSceneNode()->attachObject(shipEntity_);
+	  fishNode->getSceneNode()->setScale(Vector3(10, 10, 10));
+
+    // initialise weapon(s)
+    ammoDump_ = new AmmunitionDump();
+    ammoDump_->setDumpSize("Barrel", 1000);
+    ammoDump_->store("Barrel", 420);
+
+    InertialNode *mainWeaponNode = rootNode_->createChildNode();
+    mainWeapon_ = new BarrelGun(mainWeaponNode, ammoDump_);
+
+    railGunStation_ = new WeaponStation(4);
+    railGunStation_->addWeapon(mainWeapon_);
+    railGunStation_->selectWeapon(0);
+
+    // create some nice effects
+
+    ParticleSystem *particles = RunManager::getSingletonPtr()
+      ->getSceneManagerPtr()->createParticleSystem("asdf", "Examples/Smoke");
+
+    fishNode->getSceneNode()->attachObject(particles);
+
+
+
+
+	  return true;
+  }
+
+
+  /**
+  * Gets the ship to accelerate in the current direction.
+  * The value should be between 0 and 1, with one beeing full thrust and 0 none
+  * @param value Acceleration between 0 and 1
+  */
+  void OrxonoxShip::setMainThrust(const Real value)
+  {
+    currentThrust_.z = value * baseThrust_;
+  }
+
+
+  /**
+  * Gets the ship to accelerate sideways regarding the current direction.
+  * The value should be between 0 and 1, with one beeing full thrust and 0 none
+  * @param value Acceleration between 0 and 1
+  */
+  void OrxonoxShip::setSideThrust(const Real value)
+  {
+    currentThrust_.x = value * baseThrust_;
+  }
+
+
+  /**
+  * Gets the ship to accelerate up and down.
+  * The value should be between 0 and 1, with one beeing full thrust and 0 none
+  * @param value Acceleration between 0 and 1
+  */
+  void OrxonoxShip::setYThrust(const Real value)
+  {
+    currentThrust_.y = value * baseThrust_;
+  }
+
+
+  /**
+  * Rotate the ship along with the camera up and down.
+  * @param angle Pitch value.
+  */
+  void OrxonoxShip::turnUpAndDown(const Radian &angle)
+  {
+    rootNode_->getSceneNode()->pitch(-angle, Node::TS_LOCAL);
+  }
+
+
+  /**
+  * Rotate the ship along with the camera left and right.
+  * @param angle Yaw value.
+  */
+  void OrxonoxShip::turnLeftAndRight(const Radian &angle)
+  {
+    rootNode_->getSceneNode()->yaw(-angle, Node::TS_PARENT);
+  }
+
+
+  /**
+  * Returns the current speed of the ship according to its parent node.
+  * @return The current speed.
+  */
+  Vector3 OrxonoxShip::getSpeed()
+  {
+    return rootNode_->getSpeed();
+  }
+
+  /**
+  * Returns the ship's root SceneNode.
+  * @return The Root Node.
+  */
+  InertialNode* OrxonoxShip::getRootNode()
+  {
+    return rootNode_;
+  }
+
+
+  /**
+  * Fire a bullet (Entity with SceneNode).
+  * This method creates a new Entity plus a SceneNode. But be sure not make
+  * the new Node a child of RootNode_!
+  * @return Bullet containing speed and entity.
+  */
+  BaseWeapon* OrxonoxShip::getMainWeapon()
+  {
+    return mainWeapon_;
+  }
+
+
+  int OrxonoxShip::getAmmoStock()
+  {
+    return ammoDump_->getStockSize("Barrel");
+  }
+
+
+  /**
+  * Standard tick() function.
+  * Currently, only the speed is applied according to the thrust values.
+  * @param time Absolute time.
+  * @param deltaTime Relative time.
+  * @return Return true to continue render
+  */
+  bool OrxonoxShip::tick(unsigned long time, Real deltaTime)
+  {
+    mainWeapon_->tick(time, deltaTime);
+
+    Quaternion quad = rootNode_->getSceneNode()->getOrientation();
+    quad.normalise();
+    rootNode_->addSpeed(quad * (Vector3(-1, -1, -1) * currentThrust_) * deltaTime);
+
+    rootNode_->getSceneNode()->translate(rootNode_->getSpeed() * deltaTime);
+
+	  return true;
+  }
+
+}
Index: code/branches/merger/src/orxonox_ship.h
===================================================================
--- code/branches/merger/src/orxonox_ship.h	(revision 300)
+++ code/branches/merger/src/orxonox_ship.h	(revision 300)
@@ -0,0 +1,86 @@
+/*
+ *   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 ORXONOX_SHIP_H
+#define ORXONOX_SHIP_H
+
+#include "OgrePrerequisites.h"
+
+#include "orxonox_prerequisites.h"
+
+
+namespace orxonox {
+
+  class OrxonoxShip
+  {
+  public:
+    OrxonoxShip(Ogre::SceneNode*);
+	  virtual ~OrxonoxShip();
+
+	  virtual bool initialise();
+
+	  void setMainThrust(const Ogre::Real);
+	  void setSideThrust(const Ogre::Real);
+    void setYThrust(const Ogre::Real);
+	  void turnUpAndDown(const Ogre::Radian&);
+	  void turnLeftAndRight(const Ogre::Radian&);
+
+    InertialNode* getRootNode();
+    Ogre::Vector3 getSpeed();
+
+    weapon::BaseWeapon* getMainWeapon();
+
+    int getAmmoStock();
+
+	  bool tick(unsigned long, Ogre::Real);
+
+  protected:
+
+  protected:
+	  Ogre::SceneManager *sceneMgr_;
+	  //Ogre::SceneNode *rootNode_;
+    InertialNode *rootNode_;
+	  Ogre::Entity *shipEntity_;
+
+	  //Ogre::Vector3 currentSpeed_;  // relative to space
+	  Ogre::Vector3 currentThrust_; // relative to the ship
+    Ogre::Real baseThrust_;
+	  int objectCounter_;
+
+    weapon::BulletManager *bulletManager_;
+	  //Ogre::Vector3 bulletSpeed_;
+
+    weapon::BaseWeapon *mainWeapon_;
+    weapon::WeaponStation *railGunStation_;
+
+    weapon::AmmunitionDump *ammoDump_;
+  };
+
+}
+
+#endif /* ORXONOX_SHIP_H */
Index: code/branches/merger/src/run_manager.cc
===================================================================
--- code/branches/merger/src/run_manager.cc	(revision 300)
+++ code/branches/merger/src/run_manager.cc	(revision 300)
@@ -0,0 +1,512 @@
+/*
+*   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 "OgreVector3.h"
+#include "OgreStringConverter.h"
+#include "OgreRoot.h"
+#include "OgreSceneManager.h"
+#include "OgreSceneNode.h"
+#include "OgreCamera.h"
+#include "OgreViewport.h"
+#include "OgreRenderWindow.h"
+#include "OgreTextureManager.h"
+#include "OgreMaterialManager.h"
+#include "OgreLogManager.h"
+#include "OgreWindowEventUtilities.h"
+
+//Use this define to signify OIS will be used as a DLL
+//(so that dll import/export macros are in effect)
+#define OIS_DYNAMIC_LIB
+#include <OIS/OIS.h>
+
+#include "ogre_control.h"
+#include "orxonox_scene.h"
+#include "orxonox_ship.h"
+#include "inertial_node.h"
+
+#include "weapon/bullet.h"
+#include "weapon/bullet_manager.h"
+#include "weapon/base_weapon.h"
+
+#include "hud/hud_overlay.h"
+#include "hud/test_overlay.h"
+
+#include "run_manager.h"
+
+
+namespace orxonox {
+  using namespace Ogre;
+  using namespace weapon;
+  using namespace hud;
+
+  /**
+  * RunManager is the basic control object during the game.
+  * 
+  * The RunManger class is designed to actually "run" the main part of the
+  * game. The Idea is, that you could derive from the RunManager in order
+  * to distinguish between a first person shooter or a space craft shooter.
+  * RunManager loads and initialises everything in the scene (like the ship,
+  * the enemies in the scene, any scripts, the physics, window events,
+  * environment, HUD, etc.).
+  * It also captures any input from keyboard, mous, joystick (optional) or
+  * Ogre (window events).
+  */
+
+
+  RunManager* RunManager::singletonPtr_s = NULL;
+
+
+  /**
+  * Contructor only needs the Root object.
+  */
+  RunManager::RunManager()
+        : ogre_(NULL), window_(NULL), screenShotCounter_(0),
+        timeUntilNextToggle_(0), mouseSensitivity_(0.003), inputManager_(0),
+        mouse_(0), keyboard_(0), joystick_(0), statsOn_(true)
+  {
+  }
+
+  /**
+  * @param ogre_ The OgreControl object holding the render window and the Root
+  */
+  void RunManager::initialise(OgreControl *ogre)
+    {
+    ogre_ = ogre;
+    window_ = ogre->getRenderWindow();
+
+    // SETTING UP THE SCENE
+
+    // create one new SceneManger
+    sceneMgr_ = ogre_->getRoot()->createSceneManager(ST_GENERIC, "Orxonox Scene");
+
+    // background scene (world objects, skybox, lights, etc.)
+    backgroundScene_ = new OrxonoxScene(sceneMgr_);
+
+
+    // BULLET LIST FOR THE TEST APPLICATION
+
+    // create a bullet manager
+    bulletManager_ = new BulletManager(sceneMgr_);
+
+
+    // PLAYER SPACESHIP
+
+    // Create a space ship object and its SceneNode.
+    // It should also be considered, that the ship should provide another Node
+    // for a camera to be attached (otherwise the spaceship in front of the
+    // ship would be very static, never moving at all).
+
+    // Construct a new spaceship and give it the node
+    playerShip_ = new OrxonoxShip(sceneMgr_->getRootSceneNode()
+      ->createChildSceneNode("ShipNode", Vector3(20, 20, 20)));
+
+
+    // RESOURCE LOADING (using ResourceGroups if implemented)
+
+    // load all resources and create the entities by calling the initialise()
+    // methods for each object (no constructor initialisations!).
+    backgroundScene_->initialise();
+    playerShip_->initialise();
+
+
+    // CAMERA AND VIEWPORT
+
+    // create camera and viewport
+    createCamera();
+    createViewports();
+
+    // create HUD
+    hud_ = new hud::TestOverlay(window_);
+    hud_->show();
+
+
+    // Set default mipmap level (NB some APIs ignore this)
+    TextureManager::getSingleton().setDefaultNumMipmaps(5);
+
+
+    // HUMAN INTERFACE
+
+    using namespace OIS;    
+
+    LogManager::getSingletonPtr()->logMessage("*** Initializing OIS ***");
+    ParamList pl;
+    size_t windowHnd = 0;
+    std::ostringstream windowHndStr;
+
+    window_->getCustomAttribute("WINDOW", &windowHnd);
+    windowHndStr << windowHnd;
+    pl.insert(std::make_pair(std::string("WINDOW"), windowHndStr.str()));
+
+    inputManager_ = InputManager::createInputSystem( pl );
+
+    // Create all devices (We only catch joystick exceptions here,
+    // as, most people have Key/Mouse)
+    keyboard_ = static_cast<Keyboard*>(inputManager_
+      ->createInputObject( OISKeyboard, false ));
+    mouse_ = static_cast<Mouse*>(inputManager_
+      ->createInputObject( OISMouse, false ));
+    try {
+      joystick_ = static_cast<JoyStick*>(inputManager_
+        ->createInputObject( OISJoyStick, false ));
+    }
+    catch(...) {
+      joystick_ = 0;
+    }
+
+    //Set initial mouse clipping size
+    windowResized(window_);
+
+    //showDebugOverlay(true);
+
+    // REGISTER THIS OBJECT AS A WINDOW EVENT LISTENER IN OGRE
+    // It will then receive events liek windowClosed, windowResized, etc.
+    WindowEventUtilities::addWindowEventListener(window_, this);
+  }
+
+  /**
+  * Standard destructor.
+  * Removes this object as a window event listener and deletes all created
+  * variables.
+  */
+  RunManager::~RunManager()
+  {
+    //Remove ourself as a Window listener
+    WindowEventUtilities::removeWindowEventListener(window_, this);
+    windowClosed(window_);
+
+    if (backgroundScene_)
+      delete backgroundScene_;
+    if (playerShip_)
+      delete playerShip_;
+    if (bulletManager_)
+      delete bulletManager_;
+    if (hud_)
+      delete hud_;
+  }
+
+
+  /**
+  * Method to compute anything between 2 frames.
+  * 
+  * Everything that needs to be computed during the games happens right here.
+  * The only exception are the listeners (which should only set variables,
+  * not actually do something).
+  * 
+  * @param time Absolute play time
+  * @param deltaTime Time passed since last frame
+  * @return Return false to end rendering
+  */
+  bool RunManager::tick(unsigned long time, float deltaTime)
+  {
+    // synchronize with internal class timer
+    totalTime_ = time;
+
+    // Call tick() for every object
+    // This could be done by registering (needs a factory..)
+    backgroundScene_->tick(time, deltaTime);
+    playerShip_->tick(time, deltaTime);
+
+
+    // Update the HUD
+    Ogre::String tempStr = " | Speed = "
+      + StringConverter::toString(playerShip_->getSpeed())
+      + " | Left Ammo = "
+      + StringConverter::toString(playerShip_
+      ->getMainWeapon()->getAmmoState())
+      + " | Ammo stock = "
+      + StringConverter::toString(playerShip_->getAmmoStock());
+    hud_->setDebugText(tempStr);
+
+    hud_->tick(time, deltaTime);
+
+    // update the bullet positions
+    bulletManager_->tick(time, deltaTime);
+
+
+    // HUMAN INTERFACE
+
+    using namespace OIS;
+
+    if(window_->isClosed())	return false;
+
+    //Need to capture/update each device
+    keyboard_->capture();
+    mouse_->capture();
+    if( joystick_ ) joystick_->capture();
+
+    bool buffJ = (joystick_) ? joystick_->buffered() : true;
+
+    //Check if one of the devices is not buffered
+    if( !mouse_->buffered() || !keyboard_->buffered() || !buffJ )
+    {
+      // one of the input modes is immediate, so setup what
+      // is needed for immediate movement
+      if (timeUntilNextToggle_ >= 0)
+        timeUntilNextToggle_ -= deltaTime;
+    }
+
+    // handle HID devices
+    if( processUnbufferedKeyInput() == false )
+        return false;
+    if( processUnbufferedMouseInput() == false )
+        return false;
+
+    // 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;
+  }
+
+
+  /**
+  * Adjust mouse clipping area.
+  * This method is called by Ogre without regards of tick()!
+  * Avoid doing too much in this call.
+  * @param rw render window
+  */
+  void RunManager::windowResized(RenderWindow* rw)
+  {
+    unsigned int width, height, depth;
+    int left, top;
+    rw->getMetrics(width, height, depth, left, top);
+
+    const OIS::MouseState &ms = mouse_->getMouseState();
+    ms.width = width;
+    ms.height = height;
+  }
+
+
+  /**
+  * Unattach OIS before window shutdown (very important under Linux).
+  * Again, avoid computing a lot in this function.
+  * @param rw Render Window
+  */
+  void RunManager::windowClosed(RenderWindow* rw)
+  {
+    //Only close for window that created OIS (the main window in these demos)
+    if( rw == window_ )
+    {
+      if( inputManager_ )
+      {
+        inputManager_->destroyInputObject( mouse_ );
+        inputManager_->destroyInputObject( keyboard_ );
+        inputManager_->destroyInputObject( joystick_ );
+
+        OIS::InputManager::destroyInputSystem(inputManager_);
+        inputManager_ = 0;
+      }
+    }
+  }
+
+  /**
+  * Processes the Keyboard input.
+  * TODO: Use listeners to improve performance.
+  * A lookup table should be implemented to bind any key to a specific action.
+  * @return Return true to keep rendering
+  */
+  bool RunManager::processUnbufferedKeyInput()
+  {
+    using namespace OIS;
+
+    if(keyboard_->isKeyDown(KC_A) || keyboard_->isKeyDown(KC_LEFT))
+      playerShip_->setSideThrust(1);
+    else if(keyboard_->isKeyDown(KC_D) || keyboard_->isKeyDown(KC_RIGHT))
+      playerShip_->setSideThrust(-1);
+    else
+      playerShip_->setSideThrust(0);
+
+    if(keyboard_->isKeyDown(KC_UP) || keyboard_->isKeyDown(KC_W) )
+      playerShip_->setMainThrust(1);
+    else if(keyboard_->isKeyDown(KC_DOWN) || keyboard_->isKeyDown(KC_S) )
+      playerShip_->setMainThrust(-1);
+    else
+      playerShip_->setMainThrust(0);
+
+    if (keyboard_->isKeyDown(KC_C))
+      playerShip_->setYThrust(1);
+    else if (keyboard_->isKeyDown(KC_SPACE))
+      playerShip_->setYThrust(-1);
+    else
+      playerShip_->setYThrust(0);
+
+    if (keyboard_->isKeyDown(KC_G))
+      playerShip_->getMainWeapon()->addAction(BaseWeapon::RELOAD);
+
+    if( keyboard_->isKeyDown(KC_ESCAPE) || keyboard_->isKeyDown(KC_Q) )
+      return false;
+
+    if( keyboard_->isKeyDown(KC_F) && timeUntilNextToggle_ <= 0 )
+    {
+      statsOn_ = !statsOn_;
+      timeUntilNextToggle_ = 1;
+    }
+
+    if(keyboard_->isKeyDown(KC_SYSRQ) && timeUntilNextToggle_ <= 0)
+    {
+      std::ostringstream ss;
+      ss << "screenshot_" << ++screenShotCounter_ << ".png";
+      window_->writeContentsToFile(ss.str());
+      timeUntilNextToggle_ = 0.5;
+    }
+
+    // Return true to continue rendering
+    return true;
+  }
+
+
+  /**
+  * Processes the Mouse input.
+  * TODO: Use listeners to improve performance.
+  * A lookup table should be implemented to bind ANY button or movement
+  * to a specific action.
+  * @return Return true to keep rendering
+  */
+  bool RunManager::processUnbufferedMouseInput()
+  {
+    using namespace OIS;
+
+    const MouseState &ms = mouse_->getMouseState();
+
+    if (ms.buttonDown(MB_Left))
+      playerShip_->getMainWeapon()->primaryFireRequest();
+
+    if (ms.buttonDown(MB_Right))
+      playerShip_->getMainWeapon()->secondaryFireRequest();
+
+    playerShip_->turnUpAndDown(Radian(ms.Y.rel * mouseSensitivity_));
+    playerShip_->turnLeftAndRight(Radian(ms.X.rel * mouseSensitivity_));
+
+    // keep rendering
+    return true;
+  }
+
+  /**
+  * Show an overlay desired.
+  * @param show Whether or not to show the debug overlay
+  */
+  void RunManager::showDebugOverlay(bool show)
+  {
+    if (hud_)
+    {
+      if (show)
+        hud_->show();
+      else
+        hud_->hide();
+    }
+  }
+
+
+  /**
+  * Simple camera creator.
+  * playerShip_Node->attachObject(camera_) should not be here! This is what
+  * the camera manager is for. Right now, this method should do just fine,
+  * setting the cam behind the ship.
+  */
+  void RunManager::createCamera()
+  {
+    camera_ = sceneMgr_->createCamera("PlayerCam");
+    playerShip_->getRootNode()->getSceneNode()->attachObject(camera_);
+    camera_->setNearClipDistance(5);
+    camera_->setPosition(Vector3(0,10,500));
+    camera_->lookAt(Vector3(0,0,0));
+  }
+
+  /**
+  * Simple viewport creator.
+  * For now the viewport uses the entire render window and is based on the one
+  * camera created so far.
+  */
+  void RunManager::createViewports()
+  {
+    // Create one viewport, entire window
+    Viewport* vp = window_->addViewport(camera_);
+    vp->setBackgroundColour(ColourValue(0,0,0));
+
+    // Alter the camera aspect ratio to match the viewport
+    camera_->setAspectRatio(
+      Real(vp->getActualWidth()) / Real(vp->getActualHeight()));
+  }
+
+
+  RunManager* RunManager::createSingleton()
+  {
+    if (singletonPtr_s)
+      return NULL;
+    singletonPtr_s = new RunManager();
+    return singletonPtr_s;
+  }
+
+  void RunManager::destroySingleton()
+  {
+    if (singletonPtr_s)
+      delete singletonPtr_s;
+  }
+
+
+  RunManager& RunManager::getSingleton()
+  {
+    return *singletonPtr_s;
+  }
+
+  RunManager* RunManager::getSingletonPtr()
+  {
+    return singletonPtr_s;
+  }
+
+}
Index: code/branches/merger/src/run_manager.h
===================================================================
--- code/branches/merger/src/run_manager.h	(revision 300)
+++ code/branches/merger/src/run_manager.h	(revision 300)
@@ -0,0 +1,142 @@
+/*
+ *   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 RUN_MANAGER_H
+#define RUN_MANAGER_H
+
+#include "OgrePrerequisites.h"
+#include "OgreWindowEventUtilities.h"
+//#include "OgreTextureManager.h"
+
+#include <OIS/OISPrereqs.h>
+
+#include "orxonox_prerequisites.h"
+
+
+namespace orxonox {
+
+  // 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 : public Ogre::WindowEventListener
+  {
+  public:
+    virtual ~RunManager();
+    
+    void initialise(OgreControl*);
+
+    bool tick(unsigned long, Ogre::Real);
+
+    Ogre::SceneManager& getSceneManager();
+
+    Ogre::SceneManager* getSceneManagerPtr();
+
+    weapon::BulletManager* getBulletManagerPtr();
+
+    int getAmmunitionID(const Ogre::String&);
+
+    int getNumberOfAmmos();
+
+    static RunManager* createSingleton();
+
+    static void destroySingleton();
+
+    static RunManager& getSingleton(void);
+
+    static RunManager* getSingletonPtr(void);
+
+
+  protected:
+    RunManager();
+
+	  void createCamera(void);
+
+	  void createViewports(void);
+
+
+	  /** EVENT HANDLING **/
+
+	  //Adjust mouse clipping area
+	  void windowResized(Ogre::RenderWindow*);
+
+	  //Unattach OIS before window shutdown (very important under Linux)
+	  void windowClosed(Ogre::RenderWindow*);
+
+
+	  /** INPUT PROCESSING **/
+	  bool processUnbufferedKeyInput();
+
+	  bool processUnbufferedMouseInput();
+
+
+	  /** OUTPUT **/
+
+	  void showDebugOverlay(bool);
+
+  protected:
+    // directly Ogre related fields
+	  Ogre::SceneManager *sceneMgr_;
+	  Ogre::RenderWindow *window_;
+	  Ogre::Camera       *camera_;
+
+
+    // self made orxonox fields
+	  OgreControl  *ogre_;
+	  OrxonoxScene *backgroundScene_;
+	  OrxonoxShip  *playerShip_;
+    hud::TestOverlay *hud_;
+
+    // Bullet manager
+    weapon::BulletManager *bulletManager_;
+
+    const Ogre::Real mouseSensitivity_;
+
+	  // previously elapsed render time
+	  unsigned long totalTime_;
+
+
+    // fields from the example framework
+	  bool statsOn_;
+
+	  unsigned int screenShotCounter_;
+	  // just to stop toggles flipping too fast
+	  Ogre::Real timeUntilNextToggle_;
+
+	  //OIS Input devices
+	  OIS::InputManager* inputManager_;
+	  OIS::Mouse*    mouse_;
+	  OIS::Keyboard* keyboard_;
+	  OIS::JoyStick* joystick_;
+
+    // singleton pointer
+    static RunManager *singletonPtr_s;
+
+  };
+
+}
+
+#endif /* RUN_MANAGER_H */
Index: code/branches/merger/src/weapon/CMakeLists.txt
===================================================================
--- code/branches/merger/src/weapon/CMakeLists.txt	(revision 300)
+++ code/branches/merger/src/weapon/CMakeLists.txt	(revision 300)
@@ -0,0 +1,13 @@
+PROJECT(Orxonox)
+
+# create a few variables to simplify life
+SET( WEAPON_SRC
+	ammunition_dump.cc
+	barrel_gun.cc
+	base_weapon.cc
+	bullet.cc
+	bullet_manager.cc
+	weapon_station.cc
+)
+
+ADD_LIBRARY(WEAPON ${WEAPON_SRC} )
Index: code/branches/merger/src/weapon/ammunition_dump.cc
===================================================================
--- code/branches/merger/src/weapon/ammunition_dump.cc	(revision 300)
+++ code/branches/merger/src/weapon/ammunition_dump.cc	(revision 300)
@@ -0,0 +1,109 @@
+/*
+ *   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 "run_manager.h"
+
+#include "ammunition_dump.h"
+
+
+namespace orxonox {
+namespace weapon {
+
+  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;
+    }
+  }
+
+
+  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;
+  }
+
+  
+  int AmmunitionDump::store(const Ogre::String &name, int quantity)
+  {
+    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(const Ogre::String &name, int quantity)
+  {
+    int id = RunManager::getSingletonPtr()->getAmmunitionID(name);
+    if (id == -1)
+      return 0;
+    if (stock_[id] >= quantity)
+      stock_[id] -= quantity;
+    else
+    {
+      quantity = stock_[id];
+      stock_[id] = 0;
+    }
+    return quantity;
+  }
+
+
+  int AmmunitionDump::getStockSize(const Ogre::String &name)
+  {
+    int id = RunManager::getSingletonPtr()->getAmmunitionID(name);
+    if (id = -1)
+      return -1;
+    return stock_[id];
+  }
+}
+}
Index: code/branches/merger/src/weapon/ammunition_dump.h
===================================================================
--- code/branches/merger/src/weapon/ammunition_dump.h	(revision 300)
+++ code/branches/merger/src/weapon/ammunition_dump.h	(revision 300)
@@ -0,0 +1,66 @@
+/*
+ *   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 AmmunitionDump_H
+#define AmmunitionDump_H
+
+#include "OgrePrerequisites.h"
+
+#include "orxonox_prerequisites.h"
+
+
+namespace orxonox {
+namespace weapon {
+
+  class AmmunitionDump
+  {
+  public:
+    AmmunitionDump();
+	  ~AmmunitionDump();
+
+    void setDumpSize(const Ogre::String &name, int size);
+
+    int store(const Ogre::String &name, int quantiy);
+
+    int getAmmunition(const Ogre::String &name, int quantity);
+
+    int getStockSize(const Ogre::String &name);
+
+  protected:
+    int numberOfAmmos_;
+    int *stock_;
+    int *capacity_;
+
+  protected:
+
+  };
+
+}
+}
+
+#endif /* AmmunitionDump_H */
Index: code/branches/merger/src/weapon/barrel_gun.cc
===================================================================
--- code/branches/merger/src/weapon/barrel_gun.cc	(revision 300)
+++ code/branches/merger/src/weapon/barrel_gun.cc	(revision 300)
@@ -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 > (unsigned int)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 > (unsigned int)1000/secondaryFiringRate_)
+      currentState_ = IDLE;
+  }
+
+}
+}
Index: code/branches/merger/src/weapon/barrel_gun.h
===================================================================
--- code/branches/merger/src/weapon/barrel_gun.h	(revision 300)
+++ code/branches/merger/src/weapon/barrel_gun.h	(revision 300)
@@ -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/merger/src/weapon/base_weapon.cc
===================================================================
--- code/branches/merger/src/weapon/base_weapon.cc	(revision 300)
+++ code/branches/merger/src/weapon/base_weapon.cc	(revision 300)
@@ -0,0 +1,180 @@
+/*
+ *   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 "run_manager.h"
+
+#include "base_weapon.h"
+
+
+namespace orxonox {
+namespace weapon {
+  using namespace Ogre;
+
+  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_ = 0;
+  }
+
+
+  BaseWeapon::~BaseWeapon()
+  {
+  }
+
+
+  bool BaseWeapon::addAction(const Action act)
+  {
+    if (nextAction_ == NOTHING)
+    {
+      nextAction_ = act;
+      actionAdded_ = true;
+      return true;
+    }
+    else
+      return false;
+  }
+
+
+  void BaseWeapon::primaryFireRequest()
+  {
+    primaryFireRequest_ = true;
+  }
+
+
+  void BaseWeapon::secondaryFireRequest()
+  {
+    secondaryFireRequest_ = true;
+  }
+
+
+  bool BaseWeapon::tick(unsigned long time, Real deltaTime)
+  {
+    // process action adder
+    if (actionAdded_)
+    {
+      timeSinceNextActionAdded_ = time;
+      actionAdded_ = false;
+    }
+
+    if (currentState_ != IDLE)
+    {
+      switch (currentState_)
+      {
+      case PRIMARY_FIRE:
+        primaryFiring((unsigned int)(time - actionStartTime_));
+        break;
+
+      case SECONDARY_FIRE:
+        secondaryFiring((unsigned int)(time - actionStartTime_));
+        break;
+
+      case RELOADING:
+        break;
+
+      case CHANGING_AMMO:
+        break;
+      }
+    }
+
+    if (currentState_ == IDLE)
+    {
+      // first, process next action
+      if (nextAction_ != NOTHING)
+      {
+        actionStartTime_ = time;
+        switch (nextAction_)
+        {
+        case RELOAD:
+          leftAmmo_ += ammoDump_->getAmmunition("Barrel", magazineSize_ - leftAmmo_);
+          break;
+
+        case CHANGE_AMMO:
+          break;
+
+        case SPECIAL:
+          break;
+
+        default:
+          break;
+        }
+
+        // pay attention when multithreaded!
+        nextAction_ = NOTHING;
+      }
+      else
+      {
+        // secondly, execute firing
+        if (primaryFireRequest_ && !(secondaryFired_ && secondaryFireRequest_))
+        {
+          actionStartTime_ = time;
+          currentState_ = PRIMARY_FIRE;
+          secondaryFired_ = false;
+          primaryFire();
+        }
+        else if (secondaryFireRequest_)
+        {
+          actionStartTime_ = time;
+          currentState_ = SECONDARY_FIRE;
+          secondaryFired_ = true;
+          secondaryFire();
+        }
+      }
+    }
+
+    primaryFireRequest_ = false;
+    secondaryFireRequest_ = false;
+
+    if (time - timeSinceNextActionAdded_ > nextActionValidityPeriod_)
+      nextAction_ = NOTHING;
+
+    return true;
+  }
+
+
+  int BaseWeapon::getAmmoState()
+  {
+    return leftAmmo_;
+  }
+}
+}
Index: code/branches/merger/src/weapon/base_weapon.h
===================================================================
--- code/branches/merger/src/weapon/base_weapon.h	(revision 300)
+++ code/branches/merger/src/weapon/base_weapon.h	(revision 300)
@@ -0,0 +1,124 @@
+/*
+ *   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 BASE_WEAPON_H
+#define BASE_WEAPON_H
+
+#include "OgrePrerequisites.h"
+
+#include "orxonox_prerequisites.h"
+
+
+namespace orxonox {
+namespace weapon {
+
+  class BaseWeapon
+  {
+  public:
+    enum Action {
+      NOTHING  = 0,
+      RELOAD   = 1,
+      CHANGE_AMMO  = 2,
+      SPECIAL  = 3
+    };
+
+  protected:
+    enum State {
+      IDLE = 0,
+      PRIMARY_FIRE = 1,
+      SECONDARY_FIRE = 2,
+      RELOADING = 3,
+      CHANGING_AMMO = 4,
+    };
+
+  public:
+    BaseWeapon(InertialNode*, AmmunitionDump*);
+	  virtual ~BaseWeapon();
+
+    bool addAction(const Action);
+
+    void primaryFireRequest();
+
+    void secondaryFireRequest();
+
+    int getAmmoState();
+
+    bool tick(unsigned long, Ogre::Real);
+
+  protected:
+    virtual void primaryFire() = 0;
+
+    virtual void primaryFiring(unsigned int) = 0;
+
+    virtual void secondaryFire() = 0;
+
+    virtual void secondaryFiring(unsigned int) = 0;
+
+  public:
+
+  protected:
+    Ogre::SceneManager *sceneMgr_;
+    //Ogre::SceneNode *node_;
+    InertialNode* node_;
+
+    int bulletCounter_;
+    BulletManager *bulletManager_;
+
+    AmmunitionDump *ammoDump_;
+
+    bool primaryFireRequest_;
+    bool secondaryFireRequest_;
+
+    unsigned long actionStartTime_;
+
+    State currentState_;
+    bool secondaryFired_;
+
+    Action nextAction_;
+    bool actionAdded_;
+    unsigned long timeSinceNextActionAdded_;
+    static const unsigned long nextActionValidityPeriod_ = 500;
+
+    // weapon properties
+    int leftAmmo_;
+    Ogre::String name_;
+    int primaryFirePower_;
+    int secondaryFirePower_;
+    int primaryFiringRate_;
+    int secondaryFiringRate_;
+    Ogre::Real primaryBulletSpeed_;
+    Ogre::Real secondaryBulletSpeed_;
+
+    int magazineSize_;
+
+  };
+
+}
+}
+
+#endif /* BASE_WEAPON_H */
Index: code/branches/merger/src/weapon/bullet.cc
===================================================================
--- code/branches/merger/src/weapon/bullet.cc	(revision 300)
+++ code/branches/merger/src/weapon/bullet.cc	(revision 300)
@@ -0,0 +1,51 @@
+/*
+ *   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 "OgreSceneNode.h"
+#include "OgreEntity.h"
+#include "OgreVector3.h"
+
+#include "bullet.h"
+
+
+namespace orxonox {
+namespace weapon {
+  using namespace Ogre;
+
+  Bullet::Bullet(SceneNode *node, Entity *entity, Vector3 speed)
+    : node_(node), entity_(entity), speed_(speed)
+  {
+	  node_->attachObject(entity_);
+  }
+
+
+  Bullet::~Bullet()
+  {
+  }
+
+}
+}
Index: code/branches/merger/src/weapon/bullet.h
===================================================================
--- code/branches/merger/src/weapon/bullet.h	(revision 300)
+++ code/branches/merger/src/weapon/bullet.h	(revision 300)
@@ -0,0 +1,60 @@
+/*
+ *   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 BULLET_H
+#define BULLET_H
+
+#include "OgrePrerequisites.h"
+
+#include "orxonox_prerequisites.h"
+
+
+namespace orxonox {
+namespace weapon {
+
+  class Bullet
+  {
+  public:
+	  Bullet(Ogre::SceneNode*, Ogre::Entity*, Ogre::Vector3);
+	  ~Bullet();
+
+  protected:
+
+  public:
+    Ogre::SceneNode *node_;
+	  Ogre::Entity *entity_;
+	  Ogre::Vector3 speed_;
+
+  protected:
+
+  };
+
+}
+}
+
+#endif /* BULLET_H */
Index: code/branches/merger/src/weapon/bullet_manager.cc
===================================================================
--- code/branches/merger/src/weapon/bullet_manager.cc	(revision 300)
+++ code/branches/merger/src/weapon/bullet_manager.cc	(revision 300)
@@ -0,0 +1,90 @@
+/*
+ *   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 "OgreSceneManager.h"
+
+#include "bullet_manager.h"
+#include "bullet.h"
+
+
+namespace orxonox {
+namespace weapon {
+  using namespace Ogre;
+
+  BulletManager::BulletManager(SceneManager *sceneMgr) : sceneMgr_(sceneMgr),
+        bulletsIndex_(0), bulletsSize_(8)
+  {
+    bullets_ = new Bullet*[bulletsSize_];
+  }
+
+
+  BulletManager::~BulletManager()
+  {
+    // clean up the bullet list
+    if (bullets_)
+    {
+      for (int i = 0; i < bulletsIndex_; i++)
+        delete bullets_[i];
+      delete bullets_;
+    }
+  }
+
+
+  void BulletManager::addBullet(Bullet *bullet)
+  {
+    // resize array if neccessary (double the size then)
+    if (bulletsIndex_ >= bulletsSize_)
+    {
+      // redimension the array
+      Bullet **tempArray = new Bullet*[2*bulletsSize_];
+      for (int i = 0; i < bulletsSize_; i++)
+        tempArray[i] = bullets_[i];
+      bulletsSize_ *= 2;
+      delete bullets_;
+      bullets_ = tempArray;
+    }
+
+    // add the bullet to the list
+    bullets_[bulletsIndex_++] = bullet;
+  }
+
+
+  bool BulletManager::tick(unsigned long time, Real deltaTime)
+  {
+    // update the bullet positions
+    for (int i = 0; i < bulletsIndex_; i++)
+    {
+      bullets_[i]->node_->translate(bullets_[i]->speed_*deltaTime);
+      bullets_[i]->node_->yaw(Degree(deltaTime*100));
+      bullets_[i]->node_->roll(Degree(deltaTime*300));
+    }
+
+    return true;
+  }
+
+}
+}
Index: code/branches/merger/src/weapon/bullet_manager.h
===================================================================
--- code/branches/merger/src/weapon/bullet_manager.h	(revision 300)
+++ code/branches/merger/src/weapon/bullet_manager.h	(revision 300)
@@ -0,0 +1,66 @@
+/*
+ *   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 BULLET_MANAGER_H
+#define BULLET_MANAGER_H
+
+#include "OgrePrerequisites.h"
+
+#include "orxonox_prerequisites.h"
+
+
+namespace orxonox {
+namespace weapon {
+
+  class BulletManager
+  {
+  public:
+    BulletManager(Ogre::SceneManager*);
+	  virtual ~BulletManager();
+
+    void addBullet(Bullet*);
+
+    bool tick(unsigned long, Ogre::Real);
+
+  protected:
+
+  public:
+    Ogre::SceneManager *sceneMgr_;
+
+  protected:
+    // Bullet array
+	  Bullet **bullets_;
+	  int bulletsSize_;
+	  int bulletsIndex_;
+
+  };
+
+}
+}
+
+#endif /* BULLET_MANAGER_H */
Index: code/branches/merger/src/weapon/weapon_station.cc
===================================================================
--- code/branches/merger/src/weapon/weapon_station.cc	(revision 300)
+++ code/branches/merger/src/weapon/weapon_station.cc	(revision 300)
@@ -0,0 +1,80 @@
+/*
+ *   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 "base_weapon.h"
+
+#include "weapon_station.h"
+
+
+namespace orxonox {
+namespace weapon {
+  using namespace Ogre;
+
+  WeaponStation::WeaponStation(int stationSize)
+        : stationSize_(stationSize), lastActiveSlotIndex_(-1),
+        slots_(new BaseWeapon*[stationSize])
+  {
+  	//slots_ = new BaseWeapon*[stationSize];
+  }
+
+
+  WeaponStation::~WeaponStation()
+  {
+    if (slots_)
+      delete slots_;
+    // when factory available: delete weapons too
+  }
+
+
+  bool WeaponStation::addWeapon(BaseWeapon *weapon)
+  {
+    if (lastActiveSlotIndex_ = stationSize_ - 1)
+      return false;
+
+    // this is ugly, but for the time being, it has to fit.
+    slots_[++lastActiveSlotIndex_] = weapon;
+    selectedSlot_ = slots_ + lastActiveSlotIndex_;
+    return true;
+  }
+
+
+  BaseWeapon* WeaponStation::selectWeapon(int slotNumber)
+  {
+    if (slotNumber < lastActiveSlotIndex_)
+      return NULL;
+    return slots_[slotNumber];
+  }
+
+}
+}
Index: code/branches/merger/src/weapon/weapon_station.h
===================================================================
--- code/branches/merger/src/weapon/weapon_station.h	(revision 300)
+++ code/branches/merger/src/weapon/weapon_station.h	(revision 300)
@@ -0,0 +1,69 @@
+/*
+ *   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 WEAPON_STATION_H
+#define WEAPON_STATION_H
+
+#include "OgrePrerequisites.h"
+
+#include "orxonox_prerequisites.h"
+
+
+namespace orxonox {
+namespace weapon {
+
+  class WeaponStation
+  {
+  public:
+    WeaponStation(int slotSize);
+	  ~WeaponStation();
+
+    bool addWeapon(BaseWeapon*);
+
+    //bool removeCurrentWeapon();
+
+    // TODO: access every weapon by name
+    BaseWeapon* selectWeapon(int slotNumber);
+
+  protected:
+
+  public:
+
+  protected:
+    // slot management
+    BaseWeapon **slots_;
+    BaseWeapon **selectedSlot_;
+    int lastActiveSlotIndex_;
+    int stationSize_;
+
+  };
+
+}
+}
+
+#endif /* WEAPON_STATION_H */
