Index: code/branches/main_reto/bin/CMakeCache.txt
===================================================================
--- code/branches/main_reto/bin/CMakeCache.txt	(revision 267)
+++ code/branches/main_reto/bin/CMakeCache.txt	(revision 267)
@@ -0,0 +1,375 @@
+# This is the CMakeCache file.
+# For build in directory: d:/orxonox/project_make/bin
+# It was generated by CMake: D:/orxonox/cmake-2.4.7-win32-x86/bin/cmake.exe
+# You can edit this file to change values found and used by cmake.
+# If you do not want to change any of the values, simply exit the editor.
+# If you do want to change a value, simply edit, save, and exit the editor.
+# The syntax for the file is as follows:
+# KEY:TYPE=VALUE
+# KEY is the name of a variable in the cache.
+# TYPE is a hint to GUI's for the type of VALUE, DO NOT EDIT TYPE!.
+# VALUE is the current value for the KEY.
+
+########################
+# EXTERNAL cache entries
+########################
+
+//Library is used for debug links only
+CEGUIBase_LINK_TYPE:STATIC=optimized
+
+//Library is used for debug links only
+CEGUIBase_d_LINK_TYPE:STATIC=debug
+
+//Missing description
+CEGUI_INCLUDE_DIR:PATH=../ogre/Dependencies/include/CEGUI
+
+//Missing description
+CEGUI_LIBRARIES:STRING=debug;CEGUIBase_d;optimized;CEGUIBase
+
+//Missing description
+CEGUI_LIB_DIR:PATH=D:/orxonox/project_make/../ogre/Samples/Common/bin/Release/lib
+
+//Missing description
+CEGUI_OGRE_INCLUDE_DIR:PATH=../ogre/Samples/Common/CEGUIRenderer/include
+
+//Missing description
+CEGUI_OGRE_LIBRARIES:STRING=debug;OgreGUIRenderer_d;optimized;OgreGUIRenderer
+
+//Missing description
+CEGUI_OGRE_LIB_DIR:PATH=D:/orxonox/project_make/../ogre/Samples/Common/bin/Release/lib
+
+//Path to a program.
+CMAKE_AR:FILEPATH=CMAKE_AR-NOTFOUND
+
+//For backwards compatibility, what version of CMake commands and
+// syntax should this version of CMake allow.
+CMAKE_BACKWARDS_COMPATIBILITY:STRING=2.4
+
+//Semicolon separated list of supported configuration types, only
+// supports Debug, Release, MinSizeRel, and RelWithDebInfo, anything
+// else will be ignored.
+CMAKE_CONFIGURATION_TYPES:STRING=Debug;Release;MinSizeRel;RelWithDebInfo
+
+//C++ compiler
+CMAKE_CXX_COMPILER:FILEPATH=cl
+
+//Flags used by the compiler during all build types.
+CMAKE_CXX_FLAGS:STRING= /DWIN32 /D_WINDOWS /W3 /Zm1000 /EHsc /GR
+
+//Flags used by the compiler during debug builds.
+CMAKE_CXX_FLAGS_DEBUG:STRING=/D_DEBUG /MDd /Zi /Ob0 /Od /RTC1
+
+//Flags used by the compiler during release minsize builds.
+CMAKE_CXX_FLAGS_MINSIZEREL:STRING=/MD /O1 /Ob1 /D NDEBUG
+
+//Flags used by the compiler during release builds (/MD /Ob1 /Oi
+// /Ot /Oy /Gs will produce slightly less optimized but smaller
+// files).
+CMAKE_CXX_FLAGS_RELEASE:STRING=/MD /O2 /Ob2 /D NDEBUG
+
+//Flags used by the compiler during Release with Debug Info builds.
+//
+CMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING=/MD /Zi /O2 /Ob1 /D NDEBUG
+
+//Size of stack for programs.
+CMAKE_CXX_STACK_SIZE:STRING=10000000
+
+//Libraries linked by defalut with all C++ applications.
+CMAKE_CXX_STANDARD_LIBRARIES:STRING='kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib '
+
+//Default compiler warning level for C++.
+CMAKE_CXX_WARNING_LEVEL:STRING=3
+
+//C compiler
+CMAKE_C_COMPILER:FILEPATH=cl
+
+//Flags for C compiler.
+CMAKE_C_FLAGS:STRING= /DWIN32 /D_WINDOWS /W3 /Zm1000
+
+//Flags used by the compiler during debug builds.
+CMAKE_C_FLAGS_DEBUG:STRING=/D_DEBUG /MDd /Zi  /Ob0 /Od /RTC1
+
+//Flags used by the compiler during release minsize builds.
+CMAKE_C_FLAGS_MINSIZEREL:STRING=/MD /O1 /Ob1 /D NDEBUG
+
+//Flags used by the compiler during release builds (/MD /Ob1 /Oi
+// /Ot /Oy /Gs will produce slightly less optimized but smaller
+// files).
+CMAKE_C_FLAGS_RELEASE:STRING=/MD /O2 /Ob2 /D NDEBUG
+
+//Flags used by the compiler during Release with Debug Info builds.
+//
+CMAKE_C_FLAGS_RELWITHDEBINFO:STRING=/MD /Zi /O2 /Ob1 /D NDEBUG
+
+//Libraries linked by defalut with all C applications.
+CMAKE_C_STANDARD_LIBRARIES:STRING='kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib '
+
+//Flags used by the linker.
+CMAKE_EXE_LINKER_FLAGS:STRING= /MANIFEST /STACK:10000000 /machine:I386
+
+//Flags used by the linker during debug builds.
+CMAKE_EXE_LINKER_FLAGS_DEBUG:STRING=/debug /INCREMENTAL:YES
+
+//Flags used by the linker during release minsize builds.
+CMAKE_EXE_LINKER_FLAGS_MINSIZEREL:STRING=/INCREMENTAL:NO
+
+//Flags used by the linker during release builds.
+CMAKE_EXE_LINKER_FLAGS_RELEASE:STRING=/INCREMENTAL:NO
+
+//Flags used by the linker during Release with Debug Info builds.
+//
+CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO:STRING=/debug /INCREMENTAL:YES
+
+//Install path prefix, prepended onto install directories.
+CMAKE_INSTALL_PREFIX:PATH=C:/Program Files/Orxonox
+
+//make program
+CMAKE_MAKE_PROGRAM:FILEPATH=C:/PROGRA~1/MICROS~2/Common7/IDE/devenv.com
+
+//Flags used by the linker during the creation of modules.
+CMAKE_MODULE_LINKER_FLAGS:STRING= /MANIFEST /STACK:10000000 /machine:I386
+
+//Flags used by the linker during debug builds.
+CMAKE_MODULE_LINKER_FLAGS_DEBUG:STRING=/debug /INCREMENTAL:YES
+
+//Flags used by the linker during release minsize builds.
+CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL:STRING=/INCREMENTAL:NO
+
+//Flags used by the linker during release builds.
+CMAKE_MODULE_LINKER_FLAGS_RELEASE:STRING=/INCREMENTAL:NO
+
+//Flags used by the linker during Release with Debug Info builds.
+//
+CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO:STRING=/debug /INCREMENTAL:YES
+
+//RC compiler
+CMAKE_RC_COMPILER:FILEPATH=rc
+
+//Flags for Fortran compiler.
+CMAKE_RC_FLAGS:STRING=' '
+
+//Flags used by the linker during the creation of dll's.
+CMAKE_SHARED_LINKER_FLAGS:STRING= /MANIFEST /STACK:10000000 /machine:I386
+
+//Flags used by the linker during debug builds.
+CMAKE_SHARED_LINKER_FLAGS_DEBUG:STRING=/debug /INCREMENTAL:YES
+
+//Flags used by the linker during release minsize builds.
+CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL:STRING=/INCREMENTAL:NO
+
+//Flags used by the linker during release builds.
+CMAKE_SHARED_LINKER_FLAGS_RELEASE:STRING=/INCREMENTAL:NO
+
+//Flags used by the linker during Release with Debug Info builds.
+//
+CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO:STRING=/debug /INCREMENTAL:YES
+
+//If set, runtime paths are not added when using shared libraries.
+//
+CMAKE_SKIP_RPATH:BOOL=OFF
+
+//If true, cmake will use relative paths in makefiles and projects.
+//
+CMAKE_USE_RELATIVE_PATHS:BOOL=OFF
+
+//If this value is on, makefiles will be generated without the
+// .SILENT directive, and all commands will be echoed to the console
+// during the make.  This is useful for debugging only. With Visual
+// Studio IDE projects all commands are done without /nologo.
+CMAKE_VERBOSE_MAKEFILE:BOOL=OFF
+
+//Single output directory for building all executables.
+EXECUTABLE_OUTPUT_PATH:PATH=
+
+//Single output directory for building all libraries.
+LIBRARY_OUTPUT_PATH:PATH=
+
+//Missing description
+OGRE_INCLUDE_DIR:PATH=../ogre/OgreMain/include
+
+//Missing description
+OGRE_LIBRARIES:STRING=debug;OgreMain_d;optimized;OgreMain
+
+//Missing description
+OGRE_LIB_DIR:PATH=D:/orxonox/project_make/../ogre/Samples/Common/bin/Release
+
+//Missing description
+OIS_INCLUDE_DIR:PATH=../ogre/Dependencies/include
+
+//Missing description
+OIS_LIBRARIES:STRING=debug;OIS_d;optimized;OIS
+
+//Missing description
+OIS_LIB_DIR:PATH=D:/orxonox/project_make/../ogre/Samples/Common/bin/Release
+
+//Library is used for debug links only
+OIS_LINK_TYPE:STATIC=optimized
+
+//Library is used for debug links only
+OIS_d_LINK_TYPE:STATIC=debug
+
+//Library is used for debug links only
+OgreGUIRenderer_LINK_TYPE:STATIC=optimized
+
+//Library is used for debug links only
+OgreGUIRenderer_d_LINK_TYPE:STATIC=debug
+
+//Library is used for debug links only
+OgreMain_LINK_TYPE:STATIC=optimized
+
+//Library is used for debug links only
+OgreMain_d_LINK_TYPE:STATIC=debug
+
+//Value Computed by CMake
+Orxonox_BINARY_DIR:STATIC=D:/orxonox/project_make/bin/src
+
+//Value Computed by CMake
+Orxonox_SOURCE_DIR:STATIC=D:/orxonox/project_make/src
+
+
+########################
+# INTERNAL cache entries
+########################
+
+//Stored GUID
+../bin/main_GUID_CMAKE:INTERNAL=8F17E8DD-EF89-4C22-A0F2-167AD950D6E4
+//Stored GUID
+ALL_BUILD_GUID_CMAKE:INTERNAL=3F43A6B8-0CD9-4299-BC3F-0F8DBEC01146
+//Advanced flag for variable: CMAKE_AR
+CMAKE_AR-ADVANCED:INTERNAL=1
+//Advanced flag for variable: CMAKE_BUILD_TOOL
+CMAKE_BUILD_TOOL-ADVANCED:INTERNAL=1
+//What is the target build tool cmake is generating for.
+CMAKE_BUILD_TOOL:INTERNAL=C:/PROGRA~1/MICROS~2/Common7/IDE/devenv.com
+//This is the directory where this CMakeCahe.txt was created
+CMAKE_CACHEFILE_DIR:INTERNAL=d:/orxonox/project_make/bin
+//Major version of cmake used to create the current loaded cache
+//
+CMAKE_CACHE_MAJOR_VERSION:INTERNAL=2
+//Minor version of cmake used to create the current loaded cache
+//
+CMAKE_CACHE_MINOR_VERSION:INTERNAL=4
+//Major version of cmake used to create the current loaded cache
+//
+CMAKE_CACHE_RELEASE_VERSION:INTERNAL=patch 7
+//Path to CMake executable.
+CMAKE_COMMAND:INTERNAL=D:/orxonox/cmake-2.4.7-win32-x86/bin/cmake.exe
+//Advanced flag for variable: CMAKE_CONFIGURATION_TYPES
+CMAKE_CONFIGURATION_TYPES-ADVANCED:INTERNAL=1
+//Path to ctest program executable.
+CMAKE_CTEST_COMMAND:INTERNAL=D:/orxonox/cmake-2.4.7-win32-x86/bin/ctest.exe
+//Advanced flag for variable: CMAKE_CXX_COMPILER
+CMAKE_CXX_COMPILER-ADVANCED:INTERNAL=1
+CMAKE_CXX_COMPILER_WORKS:INTERNAL=1
+//Advanced flag for variable: CMAKE_CXX_FLAGS
+CMAKE_CXX_FLAGS-ADVANCED:INTERNAL=1
+//Advanced flag for variable: CMAKE_CXX_FLAGS_DEBUG
+CMAKE_CXX_FLAGS_DEBUG-ADVANCED:INTERNAL=1
+//Advanced flag for variable: CMAKE_CXX_FLAGS_MINSIZEREL
+CMAKE_CXX_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
+//Advanced flag for variable: CMAKE_CXX_FLAGS_RELEASE
+CMAKE_CXX_FLAGS_RELEASE-ADVANCED:INTERNAL=1
+//Advanced flag for variable: CMAKE_CXX_FLAGS_RELWITHDEBINFO
+CMAKE_CXX_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
+//Advanced flag for variable: CMAKE_CXX_STACK_SIZE
+CMAKE_CXX_STACK_SIZE-ADVANCED:INTERNAL=1
+//Advanced flag for variable: CMAKE_CXX_STANDARD_LIBRARIES
+CMAKE_CXX_STANDARD_LIBRARIES-ADVANCED:INTERNAL=1
+//Advanced flag for variable: CMAKE_CXX_WARNING_LEVEL
+CMAKE_CXX_WARNING_LEVEL-ADVANCED:INTERNAL=1
+//Advanced flag for variable: CMAKE_C_COMPILER
+CMAKE_C_COMPILER-ADVANCED:INTERNAL=1
+CMAKE_C_COMPILER_WORKS:INTERNAL=1
+//Advanced flag for variable: CMAKE_C_FLAGS
+CMAKE_C_FLAGS-ADVANCED:INTERNAL=1
+//Advanced flag for variable: CMAKE_C_FLAGS_DEBUG
+CMAKE_C_FLAGS_DEBUG-ADVANCED:INTERNAL=1
+//Advanced flag for variable: CMAKE_C_FLAGS_MINSIZEREL
+CMAKE_C_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
+//Advanced flag for variable: CMAKE_C_FLAGS_RELEASE
+CMAKE_C_FLAGS_RELEASE-ADVANCED:INTERNAL=1
+//Advanced flag for variable: CMAKE_C_FLAGS_RELWITHDEBINFO
+CMAKE_C_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
+//Advanced flag for variable: CMAKE_C_STANDARD_LIBRARIES
+CMAKE_C_STANDARD_LIBRARIES-ADVANCED:INTERNAL=1
+//Path to cache edit program executable.
+CMAKE_EDIT_COMMAND:INTERNAL=D:/orxonox/cmake-2.4.7-win32-x86/bin/CMakeSetup.exe
+//Advanced flag for variable: CMAKE_EXE_LINKER_FLAGS
+CMAKE_EXE_LINKER_FLAGS-ADVANCED:INTERNAL=1
+//Advanced flag for variable: CMAKE_EXE_LINKER_FLAGS_DEBUG
+CMAKE_EXE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1
+//Advanced flag for variable: CMAKE_EXE_LINKER_FLAGS_MINSIZEREL
+//
+CMAKE_EXE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
+//Advanced flag for variable: CMAKE_EXE_LINKER_FLAGS_RELEASE
+CMAKE_EXE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1
+//Advanced flag for variable: CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO
+//
+CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
+//Name of generator.
+CMAKE_GENERATOR:INTERNAL=Visual Studio 8 2005
+//Start directory with the top level CMakeLists.txt file for this
+// project
+CMAKE_HOME_DIRECTORY:INTERNAL=D:/orxonox/project_make
+//Advanced flag for variable: CMAKE_MAKE_PROGRAM
+CMAKE_MAKE_PROGRAM-ADVANCED:INTERNAL=1
+//Advanced flag for variable: CMAKE_MODULE_LINKER_FLAGS
+CMAKE_MODULE_LINKER_FLAGS-ADVANCED:INTERNAL=1
+//Advanced flag for variable: CMAKE_MODULE_LINKER_FLAGS_DEBUG
+CMAKE_MODULE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1
+//Advanced flag for variable: CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL
+//
+CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
+//Advanced flag for variable: CMAKE_MODULE_LINKER_FLAGS_RELEASE
+//
+CMAKE_MODULE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1
+//Advanced flag for variable: CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO
+//
+CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
+//number of local generators
+CMAKE_NUMBER_OF_LOCAL_GENERATORS:INTERNAL=2
+//noop for ranlib
+CMAKE_RANLIB:INTERNAL=:
+//Advanced flag for variable: CMAKE_RC_COMPILER
+CMAKE_RC_COMPILER-ADVANCED:INTERNAL=1
+CMAKE_RC_COMPILER_WORKS:INTERNAL=1
+//Advanced flag for variable: CMAKE_RC_FLAGS
+CMAKE_RC_FLAGS-ADVANCED:INTERNAL=1
+//Path to CMake installation.
+CMAKE_ROOT:INTERNAL=D:/orxonox/cmake-2.4.7-win32-x86/share/cmake-2.4
+//Advanced flag for variable: CMAKE_SHARED_LINKER_FLAGS
+CMAKE_SHARED_LINKER_FLAGS-ADVANCED:INTERNAL=1
+//Advanced flag for variable: CMAKE_SHARED_LINKER_FLAGS_DEBUG
+CMAKE_SHARED_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1
+//Advanced flag for variable: CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL
+//
+CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
+//Advanced flag for variable: CMAKE_SHARED_LINKER_FLAGS_RELEASE
+//
+CMAKE_SHARED_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1
+//Advanced flag for variable: CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO
+//
+CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
+//Result of TRY_RUN
+CMAKE_SIZEOF_VOID_P:INTERNAL=4
+//Advanced flag for variable: CMAKE_SKIP_RPATH
+CMAKE_SKIP_RPATH-ADVANCED:INTERNAL=1
+//Advanced flag for variable: CMAKE_USE_RELATIVE_PATHS
+CMAKE_USE_RELATIVE_PATHS-ADVANCED:INTERNAL=1
+//Advanced flag for variable: CMAKE_VERBOSE_MAKEFILE
+CMAKE_VERBOSE_MAKEFILE-ADVANCED:INTERNAL=1
+//Stored GUID
+EDIT_CACHE_GUID_CMAKE:INTERNAL=1DE5DAE6-289E-4E4A-B940-28E28BF11CD4
+//Result of TRY_COMPILE
+HAVE_CMAKE_SIZEOF_VOID_P:INTERNAL=TRUE
+//Stored GUID
+INSTALL_GUID_CMAKE:INTERNAL=0674E882-E93A-413B-868D-A7B23DF04DE3
+//Stored GUID
+PACKAGE_GUID_CMAKE:INTERNAL=62F1CD05-C002-4EE4-B5A6-4F63E00AFF45
+//Stored GUID
+REBUILD_CACHE_GUID_CMAKE:INTERNAL=77BD3F50-1E2D-4E04-8744-69AFB6D92B55
+//Stored GUID
+RUN_TESTS_GUID_CMAKE:INTERNAL=32FE96A7-4B32-4AD9-9D2C-D036887B28B7
+//Stored GUID
+ZERO_CHECK_GUID_CMAKE:INTERNAL=573F13E6-3D74-491E-909A-3C24E9303E85
+
Index: code/branches/main_reto/src/CMakeLists.txt
===================================================================
--- code/branches/main_reto/src/CMakeLists.txt	(revision 266)
+++ code/branches/main_reto/src/CMakeLists.txt	(revision 267)
@@ -2,15 +2,14 @@
 
 # create a few variables to simplify life
-SET(SRC_FILES
-	orxonox.cc
-	main.cc
+SET( ORXONOX_SRC
 	camera_manager.cc
 	inertial_node.cc
+	main.cc
 	ogre_control.cc
+	orxonox.cc
 	orxonox_scene.cc
 	orxonox_ship.cc
-	run_manager.cc)
+	run_manager.cc
 
-SET(INC_FILES
 	camera_manager.h
 	inertial_node.h
@@ -20,11 +19,14 @@
 	orxonox_scene.h
 	orxonox_ship.h
-	run_manager.h)
+	run_manager.h
+   )
 
 #Creates an executable
-ADD_EXECUTABLE(../bin/main ${SRC_FILES, weapon/WPN_CC_FILES} ${INC_FILES, weapon/WPN_H_FILES})
-#Links the executable against OGRE and OIS
-TARGET_LINK_LIBRARIES(../bin/main ${OGRE_LIBRARIES} ${OIS_LIBRARIES} ${CEGUI_LIBRARIES} ${CEGUI_OGRE_LIBRARIES})
+ADD_EXECUTABLE(../bin/main ${ORXONOX_SRC} )
 
 #add weapon source dir
-ADD_SUBDIRECTORY(weapon)
+#ADD_SUBDIRECTORY(weapon)
+
+#Links the executable against OGRE and OIS
+TARGET_LINK_LIBRARIES(../bin/main WEAPON ${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/main_reto/src/main.cc
===================================================================
--- code/branches/main_reto/src/main.cc	(revision 266)
+++ code/branches/main_reto/src/main.cc	(revision 267)
@@ -31,4 +31,11 @@
 #include "orxonox.h"
 
+#include "class_hierarchy/BaseObject.h"
+#include "class_hierarchy/Test.h"
+#include "class_hierarchy/test1.h"
+#include "class_hierarchy/test2.h"
+#include "class_hierarchy/test3.h"
+
+
 #ifdef __cplusplus
 extern "C" {
@@ -43,4 +50,5 @@
 #endif 
   {
+#if 1
     try {
       // create an orxonox application and run it
@@ -60,4 +68,49 @@
     }
 
+#else
+#define testandcout(code) \
+    std::cout << #code << " " << code << "\n"
+
+    using namespace orxonox;
+
+    std::cout << "Test 8\n";
+
+    std::cout << "1\n";
+    Test1* test8_01 = new Test1;
+    Test1* asdf = new Test1;
+    Test3* test8_03 = new Test3;
+    test8_03->usefullClassesIsATest(test8_01);
+
+    std::cout << "2\n";
+    Test2* test8_02 = new Test2;
+    test8_03->usefullClassesIsATest(test8_02);
+
+    std::cout << "3\n";
+    test8_01->setUsefullClass1(Class(Test1));
+    test8_01->setUsefullClass1(test8_02->getIdentifier());
+    test8_01->setUsefullClass2(Class(Test2));
+    test8_01->setUsefullClassOfTypeTest3(Class(Test3));
+    test8_01->setUsefullClassOfTypeTest3(test8_03->getIdentifier());
+
+
+    testandcout(test8_01->isA(Class(Test1)));
+    testandcout(test8_01->isA(Class(Test2)));
+    testandcout(test8_01->isA(Class(Test3)));
+
+    Test2* test8_04 = new Test2;
+    testandcout(test8_02->isA(Class(Test1)));
+    testandcout(test8_02->isA(Class(Test2)));
+    testandcout(test8_02->isA(Class(Test3)));
+
+    Test3* test8_05 = new Test3;
+    testandcout(test8_03->isA(Class(Test1)));
+    testandcout(test8_03->isA(Class(Test2)));
+    testandcout(test8_03->isA(Class(Test3)));
+
+    delete test8_01;
+    delete test8_02;
+    delete test8_03;
+
+#endif
     return 0;
   }
Index: code/branches/main_reto/src/orxonox_prerequisites.h
===================================================================
--- code/branches/main_reto/src/orxonox_prerequisites.h	(revision 266)
+++ code/branches/main_reto/src/orxonox_prerequisites.h	(revision 267)
@@ -46,6 +46,14 @@
     class Bullet;
     class BulletManager;
-    class Weapon;
-    class WeaponManager;
+    class BaseWeapon;
+    class BarrelGun;
+    class WeaponStation;
+
+  }
+
+
+  namespace hud {
+    
+    class HUDOverlay;
 
   }
Index: code/branches/main_reto/src/orxonox_scene.cc
===================================================================
--- code/branches/main_reto/src/orxonox_scene.cc	(revision 266)
+++ code/branches/main_reto/src/orxonox_scene.cc	(revision 267)
@@ -98,5 +98,5 @@
   void OrxonoxScene::createScene()
   {
-	  sceneMgr_->setAmbientLight(ColourValue(0.3,0.3,0.3));
+	  sceneMgr_->setAmbientLight(ColourValue(0.3,0.3,0.3)*2);
 
 	  //create first entity
@@ -110,5 +110,5 @@
 
 	  // set up skybox
-	  sceneMgr_->setSkyBox(true, "Examples/SceneSkyBox2");
+	  sceneMgr_->setSkyBox(true, "Examples/SceneSkyBox1");
 
 	  // set up one light_ source
Index: code/branches/main_reto/src/orxonox_ship.cc
===================================================================
--- code/branches/main_reto/src/orxonox_ship.cc	(revision 266)
+++ code/branches/main_reto/src/orxonox_ship.cc	(revision 267)
@@ -26,14 +26,20 @@
  */
 
-#include "OgreSceneManager.h"
+#include "OgreMath.h"
+#include "OgreVector3.h"
+#include "OgreQuaternion.h"
 #include "OgreSceneNode.h"
 #include "OgreEntity.h"
-#include "OgreVector3.h"
-#include "OgreStringConverter.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_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"
@@ -65,9 +71,8 @@
   * @param mNode The scene node which the ship will be attached to later.
   */
-  OrxonoxShip::OrxonoxShip(SceneManager *sceneMgr, SceneNode *node,
-        BulletManager *bulletManager)
-	      : sceneMgr_(sceneMgr), //currentSpeed_(Vector3(0, 0, 0)),
-        baseThrust_(1000), currentThrust_(Vector3::ZERO),
-        objectCounter_(0), bulletManager_(bulletManager)//, bulletSpeed_(400)
+  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);
@@ -83,4 +88,6 @@
     if (mainWeapon_)
       delete mainWeapon_;
+    if (railGunStation_)
+      delete railGunStation_;
     if (rootNode_)
       delete rootNode_;
@@ -110,8 +117,24 @@
 
     // initialise weapon(s)
+    ammoDump_ = new AmmunitionDump();
+    ammoDump_->setDumpSize("Barrel", 1000);
+    ammoDump_->store("Barrel", 420);
+
     InertialNode *mainWeaponNode = rootNode_->createChildNode();
-    mainWeapon_ = new WeaponManager(sceneMgr_, mainWeaponNode,
-          bulletManager_, 1);
-    mainWeapon_->addWeapon("Barrel Gun");
+    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;
@@ -197,7 +220,13 @@
   * @return Bullet containing speed and entity.
   */
-  void OrxonoxShip::fire()
-  {
-    mainWeapon_->primaryFireRequest();
+  BaseWeapon* OrxonoxShip::getMainWeapon()
+  {
+    return mainWeapon_;
+  }
+
+
+  int OrxonoxShip::getAmmoStock()
+  {
+    return ammoDump_->getStockSize("Barrel");
   }
 
Index: code/branches/main_reto/src/orxonox_ship.h
===================================================================
--- code/branches/main_reto/src/orxonox_ship.h	(revision 266)
+++ code/branches/main_reto/src/orxonox_ship.h	(revision 267)
@@ -40,5 +40,5 @@
   {
   public:
-    OrxonoxShip(Ogre::SceneManager*, Ogre::SceneNode*, weapon::BulletManager*);
+    OrxonoxShip(Ogre::SceneNode*);
 	  virtual ~OrxonoxShip();
 
@@ -54,5 +54,7 @@
     Ogre::Vector3 getSpeed();
 
-	  void fire();
+    weapon::BaseWeapon* getMainWeapon();
+
+    int getAmmoStock();
 
 	  bool tick(unsigned long, Ogre::Real);
@@ -74,5 +76,8 @@
 	  //Ogre::Vector3 bulletSpeed_;
 
-    weapon::WeaponManager *mainWeapon_;
+    weapon::BaseWeapon *mainWeapon_;
+    weapon::WeaponStation *railGunStation_;
+
+    weapon::AmmunitionDump *ammoDump_;
   };
 
Index: code/branches/main_reto/src/run_manager.cc
===================================================================
--- code/branches/main_reto/src/run_manager.cc	(revision 266)
+++ code/branches/main_reto/src/run_manager.cc	(revision 267)
@@ -56,11 +56,19 @@
 #include "weapon/bullet.h"
 #include "weapon/bullet_manager.h"
-#include "weapon/weapon_manager.h"
+#include "weapon/base_weapon.h"
+
+#include "hud/hud_overlay.h"
 
 #include "run_manager.h"
+
+namespace Ogre {
+  using namespace orxonox;
+  template<> RunManager* Singleton<RunManager>::ms_Singleton = 0;
+}
 
 namespace orxonox {
   using namespace Ogre;
   using namespace weapon;
+  using namespace hud;
 
   /**
@@ -77,4 +85,13 @@
   */
 
+  RunManager* RunManager::getSingletonPtr(void)
+  {
+      return ms_Singleton;
+  }
+  RunManager& RunManager::getSingleton(void)
+  {  
+      assert( ms_Singleton );  return ( *ms_Singleton );  
+  }
+
 
   /**
@@ -88,5 +105,5 @@
   */
   RunManager::RunManager(OgreControl * ogre)
-        : ogre_(ogre), window_(ogre->getRenderWindow()), leftButtonDown_(false),
+        : ogre_(ogre), window_(ogre->getRenderWindow()), //leftButtonDown_(false),
         statsOn_(true), screenShotCounter_(0), timeUntilNextToggle_(0),
         filtering_(TFO_BILINEAR), aniso_(1), sceneDetailIndex_(0),
@@ -94,9 +111,8 @@
         debugOverlay_(0), inputManager_(0), mouse_(0), keyboard_(0), joystick_(0)
   {
-
     // SETTING UP THE SCENE
 
     // create one new SceneManger
-    sceneMgr_ = ogre_->getRoot()->createSceneManager(ST_GENERIC, "backgroundScene_");
+    sceneMgr_ = ogre_->getRoot()->createSceneManager(ST_GENERIC, "Orxonox Scene");
 
     // background scene (world objects, skybox, lights, etc.)
@@ -108,10 +124,4 @@
     // create a bullet manager
     bulletManager_ = new BulletManager(sceneMgr_);
-    WeaponManager::loadWeapons();
-
-    // TODO: Use STL to make life easier. But it works this way too..
-    /*bullets_ = new Bullet*[10];
-    bulletsIndex_ = 0;
-    bulletsSize_ = 10;*/
 
 
@@ -131,6 +141,6 @@
 
     // Construct a new spaceship and give it the node
-    playerShip_ = new OrxonoxShip(sceneMgr_, sceneMgr_->getRootSceneNode()
-      ->createChildSceneNode("ShipNode", Vector3(20, 20, 20)), bulletManager_);
+    playerShip_ = new OrxonoxShip(sceneMgr_->getRootSceneNode()
+      ->createChildSceneNode("ShipNode", Vector3(20, 20, 20)));
 
 
@@ -153,4 +163,8 @@
     createViewports();
 
+    // create HUD
+    hud_ = new HUDOverlay();
+    hud_->show();
+
 
     // Set default mipmap level (NB some APIs ignore this)
@@ -163,6 +177,7 @@
     using namespace OIS;
 
-    debugOverlay_ = OverlayManager::getSingleton()
-      .getByName("Core/DebugOverlay");
+    //debugOverlay_ = OverlayManager::getSingleton()
+    //  .getByName("Core/DebugOverlay");
+    
 
     LogManager::getSingletonPtr()->logMessage("*** Initializing OIS ***");
@@ -194,5 +209,5 @@
     windowResized(window_);
 
-    showDebugOverlay(true);
+    //showDebugOverlay(true);
 
     // REGISTER THIS OBJECT AS A WINDOW EVENT LISTENER IN OGRE
@@ -218,11 +233,4 @@
     if (bulletManager_)
       delete bulletManager_;
-
-    WeaponManager::destroyWeapons();
-
-    // clean up the bullet list
-    /*for (int i = 0; i < bulletsIndex_; i++)
-      delete bullets_[i];
-    delete bullets_;*/
   }
 
@@ -251,15 +259,9 @@
 
     // Update the 'HUD'
-    updateStats();
+    //updateStats();
 
     // update the bullet positions
     bulletManager_->tick(time, deltaTime);
 
-    /*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));
-    }*/
 
     // HUMAN INTERFACE
@@ -293,4 +295,38 @@
     // keep rendering
     return true;
+  }
+
+
+  SceneManager& RunManager::getSceneManager()
+  {
+    return *sceneMgr_;
+  }
+
+  SceneManager* RunManager::getSceneManagerPtr()
+  {
+    return sceneMgr_;
+  }
+
+  BulletManager* RunManager::getBulletManagerPtr()
+  {
+    return bulletManager_;
+  }
+
+  int RunManager::getAmmunitionID(const Ogre::String &ammoName)
+  {
+    Ogre::String ammoTypes[] = { "Energy Cell", "Barrel", "Lead Shot" };
+    int ammoTypesLength = 3;
+
+    for (int i = 0; i < ammoTypesLength; i++)
+    {
+      if (ammoTypes[i] == ammoName)
+        return i;
+    }
+    return -1;
+  }
+
+  int RunManager::getNumberOfAmmos()
+  {
+    return 3;
   }
 
@@ -367,4 +403,7 @@
       playerShip_->setYThrust(0);
 
+    if (keyboard_->isKeyDown(KC_G))
+      playerShip_->getMainWeapon()->addAction(BaseWeapon::RELOAD);
+
     if( keyboard_->isKeyDown(KC_ESCAPE) || keyboard_->isKeyDown(KC_Q) )
       return false;
@@ -373,5 +412,5 @@
     {
       statsOn_ = !statsOn_;
-      showDebugOverlay(statsOn_);
+      //showDebugOverlay(statsOn_);
       timeUntilNextToggle_ = 1;
     }
@@ -398,5 +437,5 @@
       MaterialManager::getSingleton().setDefaultAnisotropy(aniso_);
 
-      showDebugOverlay(statsOn_);
+      //showDebugOverlay(statsOn_);
       timeUntilNextToggle_ = 1;
     }
@@ -434,5 +473,10 @@
     if(displayCameraDetails)
       debugText_ = " | Speed = "
-            + StringConverter::toString(playerShip_->getSpeed());
+            + StringConverter::toString(playerShip_->getSpeed())
+            + " | Left Ammo = "
+            + StringConverter::toString(playerShip_
+            ->getMainWeapon()->getAmmoState())
+            + " | Ammo stock = "
+            + StringConverter::toString(playerShip_->getAmmoStock());
     // debugText_ = "P: " + StringConverter::toString(camera_
     //      ->getDerivedPosition()) + " " + "O: "
@@ -457,42 +501,12 @@
     const MouseState &ms = mouse_->getMouseState();
 
-    // This is a 'hack' to show some flying barrels..
-    // Usually, the Bullet created by the ship should be managed
-    // by the physics engine..
-    if (ms.buttonDown(MB_Left) && !leftButtonDown_)
-    {
-      // Prevent continuous fire for the moment.
-      leftButtonDown_ = true;
-
-      playerShip_->fire();
-      
-      // let ship fire one shot with its only weapon (Barrels..)
-      /*Bullet *tempBullet = playerShip_->fire();
-
-      // 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_++] = tempBullet;*/
-
-    }
-    else if (!ms.buttons)
-      leftButtonDown_ = false;
-
-    // space ship steering. This should definitely be done in the steering object
-    // Simply give it the mouse movements.
+    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_));
-    //playerShip_->mRootNode->pitch(Degree(-ms.Y.rel * 0.13), Ogre::Node::TransformSpace::TS_LOCAL);
-    //playerShip_->mRootNode->yaw(Degree(-ms.X.rel * 0.13), Ogre::Node::TransformSpace::TS_PARENT);
 
     // keep rendering
@@ -565,5 +579,4 @@
 
 
-
   /**
   * Simple camera creator.
@@ -583,6 +596,4 @@
   /**
   * Simple viewport creator.
-  * TODO: fully understand the concept of viewports concerning orxnox.
-  * E.g. do we need splitscreen mode?
   * For now the viewport uses the entire render window and is based on the one
   * camera created so far.
Index: code/branches/main_reto/src/run_manager.h
===================================================================
--- code/branches/main_reto/src/run_manager.h	(revision 266)
+++ code/branches/main_reto/src/run_manager.h	(revision 267)
@@ -33,4 +33,5 @@
 #include "OgreWindowEventUtilities.h"
 #include "OgreTextureManager.h"
+#include "OgreSingleton.h"
 
 #include <OIS/OISPrereqs.h>
@@ -43,17 +44,34 @@
   // let the class inherit from WindowEventListener in order for the RunMgr
   // to act as the central point of all the calcuations in Orxonox
-  class RunManager : Ogre::WindowEventListener
+  class RunManager : public Ogre::WindowEventListener,
+                     public Ogre::Singleton<RunManager>
   {
   public:
-	  RunManager(OgreControl*);
+    RunManager(OgreControl*);
 
-	  virtual ~RunManager();
+    virtual ~RunManager();
+    //void initialise(OgreControl*);
 
-    virtual bool tick(unsigned long, Ogre::Real);
+    bool tick(unsigned long, Ogre::Real);
+
+    Ogre::SceneManager& getSceneManager();
+
+    Ogre::SceneManager* getSceneManagerPtr();
+
+    weapon::BulletManager* getBulletManagerPtr();
+
+    int getAmmunitionID(const Ogre::String&);
+
+    int getNumberOfAmmos();
+
+    static RunManager& getSingleton(void);
+
+    static RunManager* getSingletonPtr(void);
+
 
   protected:
-	  virtual void createCamera(void);
+	  void createCamera(void);
 
-	  virtual void createViewports(void);
+	  void createViewports(void);
 
 
@@ -61,30 +79,45 @@
 
 	  //Adjust mouse clipping area
-	  virtual void windowResized(Ogre::RenderWindow*);
+	  void windowResized(Ogre::RenderWindow*);
 
 	  //Unattach OIS before window shutdown (very important under Linux)
-	  virtual void windowClosed(Ogre::RenderWindow*);
+	  void windowClosed(Ogre::RenderWindow*);
 
 
 	  /** INPUT PROCESSING **/
-	  virtual bool processUnbufferedKeyInput();
+	  bool processUnbufferedKeyInput();
 
-	  virtual bool processUnbufferedMouseInput();
+	  bool processUnbufferedMouseInput();
 
 
 	  /** OUTPUT **/
 
-	  virtual void updateStats(void);
+	  void updateStats(void);
 
-	  virtual void showDebugOverlay(bool);
+	  void showDebugOverlay(bool);
 
   protected:
+    // directly Ogre related fields
 	  Ogre::SceneManager *sceneMgr_;
 	  Ogre::RenderWindow *window_;
 	  Ogre::Camera       *camera_;
+
+
+    // self made orxonox fields
 	  OgreControl  *ogre_;
 	  OrxonoxScene *backgroundScene_;
 	  OrxonoxShip  *playerShip_;
+    hud::HUDOverlay   *hud_;
 
+    // Bullet manager
+    weapon::BulletManager *bulletManager_;
+
+    const Ogre::Real mouseSensitivity_;
+
+	  // previously elapsed render time
+	  unsigned long totalTime_;
+
+
+    // fields from the example framework
 	  bool statsOn_;
 	  std::string debugText_;
@@ -93,8 +126,7 @@
 	  // just to stop toggles flipping too fast
 	  Ogre::Real timeUntilNextToggle_;
-	  bool leftButtonDown_;
+	  //bool leftButtonDown_;
 	  Ogre::TextureFilterOptions filtering_;
 	  int aniso_;
-
 	  int sceneDetailIndex_;
 	  Ogre::Overlay* debugOverlay_;
@@ -106,15 +138,4 @@
 	  OIS::JoyStick* joystick_;
 
-    const Ogre::Real mouseSensitivity_;
-
-    // Bullet array
-	  /*Bullet **bullets_;
-	  int bulletsSize_;
-	  int bulletsIndex_;*/
-    weapon::BulletManager *bulletManager_;
-
-	  // previously elapsed render time
-	  unsigned long totalTime_;
-
   };
 
Index: code/branches/main_reto/src/weapon/CMakeLists.txt
===================================================================
--- code/branches/main_reto/src/weapon/CMakeLists.txt	(revision 266)
+++ code/branches/main_reto/src/weapon/CMakeLists.txt	(revision 267)
@@ -2,14 +2,19 @@
 
 # create a few variables to simplify life
-SET(WPN_CC_FILES
+SET( WEAPON_SRC
 	ammunition_dump.cc
+	barrel_gun.cc
+	base_weapon.cc
 	bullet.cc
 	bullet_manager.cc
-	weapon_manager.cc)
-SET(WPN_H_FILES
+	weapon_station.cc
+
 	ammunition_dump.h
+	barrel_gun.h
+	base_weapon.h
 	bullet.h
 	bullet_manager.h
-	weapon.h
-	weapon_manager.h)
+	weapon_station.h
+   )
 
+#ADD_LIBRARY(WEAPON ${WEAPON_SRC} )
Index: code/branches/main_reto/src/weapon/ammunition_dump.cc
===================================================================
--- code/branches/main_reto/src/weapon/ammunition_dump.cc	(revision 266)
+++ code/branches/main_reto/src/weapon/ammunition_dump.cc	(revision 267)
@@ -26,4 +26,6 @@
  */
 
+#include "run_manager.h"
+
 #include "ammunition_dump.h"
 
@@ -33,5 +35,13 @@
 
   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;
+    }
   }
 
@@ -39,6 +49,61 @@
   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/main_reto/src/weapon/ammunition_dump.h
===================================================================
--- code/branches/main_reto/src/weapon/ammunition_dump.h	(revision 266)
+++ code/branches/main_reto/src/weapon/ammunition_dump.h	(revision 267)
@@ -41,8 +41,19 @@
   {
   public:
-	  AmmunitionDump();
+    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:
Index: code/branches/main_reto/src/weapon/barrel_gun.cc
===================================================================
--- code/branches/main_reto/src/weapon/barrel_gun.cc	(revision 267)
+++ code/branches/main_reto/src/weapon/barrel_gun.cc	(revision 267)
@@ -0,0 +1,140 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation, either version 3 of the License, or
+ *   (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "OgreMath.h"
+#include "OgreVector3.h"
+#include "OgreStringConverter.h"
+#include "OgreSceneNode.h"
+#include "OgreEntity.h"
+#include "OgreSceneManager.h"
+
+#include "bullet.h"
+#include "bullet_manager.h"
+#include "inertial_node.h"
+#include "ammunition_dump.h"
+#include "base_weapon.h"
+
+#include "barrel_gun.h"
+
+
+namespace orxonox {
+namespace weapon {
+  using namespace Ogre;
+
+  BarrelGun::BarrelGun(InertialNode *node, AmmunitionDump *ammoDump)
+        : BaseWeapon(node, ammoDump)
+  {
+    name_ = "Barrel Gun";
+    primaryFirePower_ = 100;
+    secondaryFirePower_ = 500;
+    primaryFiringRate_ = 10;
+    secondaryFiringRate_ = 2;
+    primaryBulletSpeed_ = 1000;
+    secondaryBulletSpeed_ = 500;
+    magazineSize_ = 25;
+  }
+
+
+  BarrelGun::~BarrelGun()
+  {
+  }
+
+
+  void BarrelGun::primaryFire()
+  {
+    if (leftAmmo_ < 1)
+    {
+      currentState_ = IDLE;
+      return;
+    }
+
+    SceneNode *temp = sceneMgr_->getRootSceneNode()->createChildSceneNode(
+          node_->getSceneNode()->getWorldPosition(),
+          node_->getSceneNode()->getWorldOrientation());
+
+    Entity* bulletEntity = sceneMgr_->createEntity("BulletEntity"
+          + StringConverter::toString(bulletCounter_++), "Barrel.mesh");
+
+    Vector3 speed = (temp->getOrientation() * Vector3(0, 0, -1))
+          .normalisedCopy() * primaryBulletSpeed_;
+    speed += node_->getWorldSpeed();
+
+	  temp->setScale(Vector3(1, 1, 1) * 4);
+	  temp->yaw(Degree(-90));
+
+	  bulletManager_->addBullet(new Bullet(temp, bulletEntity, speed));
+
+    --leftAmmo_;
+  }
+
+
+  void BarrelGun::primaryFiring(unsigned int time)
+  {
+    if (time > 1000/primaryFiringRate_)
+    {
+      currentState_ = IDLE;
+    }
+  }
+
+
+
+  void BarrelGun::secondaryFire()
+  {
+    if (leftAmmo_ < 5)
+    {
+      currentState_ = IDLE;
+      return;
+    }
+
+    SceneNode *temp = sceneMgr_->getRootSceneNode()->createChildSceneNode(
+          node_->getSceneNode()->getWorldPosition(),
+          node_->getSceneNode()->getWorldOrientation());
+
+    Entity* bulletEntity = sceneMgr_->createEntity("BulletEntity"
+          + StringConverter::toString(bulletCounter_++), "Barrel.mesh");
+
+    Vector3 speed = (temp->getOrientation() * Vector3(0, 0, -1))
+          .normalisedCopy() * secondaryBulletSpeed_*0.5;
+    speed += node_->getWorldSpeed();
+
+	  temp->setScale(Vector3(1, 1, 1) * 10);
+	  temp->yaw(Degree(-90));
+
+	  bulletManager_->addBullet(new Bullet(temp, bulletEntity, speed));
+
+    leftAmmo_ -= 5;
+  }
+
+
+  void BarrelGun::secondaryFiring(unsigned int time)
+  {
+    if (time > 1000/secondaryFiringRate_)
+      currentState_ = IDLE;
+  }
+
+}
+}
Index: code/branches/main_reto/src/weapon/barrel_gun.h
===================================================================
--- code/branches/main_reto/src/weapon/barrel_gun.h	(revision 267)
+++ code/branches/main_reto/src/weapon/barrel_gun.h	(revision 267)
@@ -0,0 +1,65 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation, either version 3 of the License, or
+ *   (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+
+#ifndef BARREL_GUN_H
+#define BARREL_GUN_H
+
+#include "OgrePrerequisites.h"
+
+#include "orxonox_prerequisites.h"
+
+
+namespace orxonox {
+namespace weapon {
+
+  class BarrelGun : public BaseWeapon
+  {
+ public:
+    BarrelGun(InertialNode*, AmmunitionDump*);
+	  virtual ~BarrelGun();
+
+    bool tick(unsigned long, Ogre::Real);
+
+  protected:
+    void primaryFire();
+
+    void primaryFiring(unsigned int);
+
+    void secondaryFire();
+
+    void secondaryFiring(unsigned int);
+
+  public:
+
+  protected:
+
+  };
+}
+}
+
+#endif /* BARREL_GUN_H */
Index: code/branches/main_reto/src/weapon/base_weapon.cc
===================================================================
--- code/branches/main_reto/src/weapon/base_weapon.cc	(revision 267)
+++ code/branches/main_reto/src/weapon/base_weapon.cc	(revision 267)
@@ -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/main_reto/src/weapon/base_weapon.h
===================================================================
--- code/branches/main_reto/src/weapon/base_weapon.h	(revision 267)
+++ code/branches/main_reto/src/weapon/base_weapon.h	(revision 267)
@@ -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/main_reto/src/weapon/weapon.h
===================================================================
--- code/branches/main_reto/src/weapon/weapon.h	(revision 266)
+++ 	(revision )
@@ -1,60 +1,0 @@
-/*
- *   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_H
-#define WEAPON_H
-
-#include "OgrePrerequisites.h"
-#include "OgreString.h"
-
-#include "orxonox_prerequisites.h"
-
-namespace orxonox {
-namespace weapon {
-
-  class Weapon
-  {
-  public:
-    Weapon(const Ogre::String &name, int firePower, int firingRate,
-      Ogre::Real bulletSpeed)
-          : name_(name), firePower_(firePower), firingRate_(firingRate),
-          bulletSpeed_(bulletSpeed) { }
-
-    virtual ~Weapon() { }
-
-  public:
-    Ogre::String name_;
-    int firePower_;
-    int firingRate_;
-    Ogre::Real bulletSpeed_;
-  };
-
-}
-}
-
-#endif /* WEAPON_H */
Index: code/branches/main_reto/src/weapon/weapon_manager.cc
===================================================================
--- code/branches/main_reto/src/weapon/weapon_manager.cc	(revision 266)
+++ 	(revision )
@@ -1,225 +1,0 @@
-/*
- *   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 "OgreEntity.h"
-#include "OgreSceneNode.h"
-#include "OgreVector3.h"
-#include "OgreStringConverter.h"
-
-#include "weapon.h"
-#include "bullet.h"
-#include "bullet_manager.h"
-#include "inertial_node.h"
-#include "weapon_manager.h"
-
-#define ACTION_LIST_SIZE 4
-
-
-namespace orxonox {
-namespace weapon {
-  using namespace Ogre;
-
-  Weapon** WeaponManager::weaponList_s = NULL;
-
-  WeaponManager::WeaponManager(SceneManager *sceneMgr, InertialNode *node,
-        BulletManager *bulletManager, int slotSize)
-        : sceneMgr_(sceneMgr), node_(node), slotSize_(slotSize), slotIndex_(0),
-        bulletCounter_(0), primaryFireRequest_(false), currentState_(IDLE),
-        secondaryFireRequest_(false), selectedWeapon_(0),
-        bulletManager_(bulletManager),
-        actionListReadIndex_(0), actionListWriteIndex_(0)
-  {
-  	slots_ = new Weapon*[slotSize];
-    actionList_ = new Action[ACTION_LIST_SIZE];
-    for (int i = 0; i < ACTION_LIST_SIZE; i++)
-      actionList_[i] = NOTHING;
-  }
-
-
-  WeaponManager::~WeaponManager()
-  {
-    if (slots_)
-      delete slots_;
-    if (actionList_)
-      delete actionList_;
-  }
-
-
-  bool WeaponManager::addWeapon(const Ogre::String &name)
-  {
-    if (!weaponList_s)
-      return false;
-
-    if (name == weaponList_s[0]->name_)
-    {
-      // this is ugly, but for the time being, it has to fit.
-      selectedWeapon_ = slotIndex_;
-      slots_[slotIndex_++] = weaponList_s[0];
-      return true;
-    }
-    else
-      return false;
-  }
-
-
-  bool WeaponManager::addAction(const Action act)
-  {
-    if (actionList_[actionListWriteIndex_] == NOTHING)
-    {
-      actionList_[actionListWriteIndex_] = act;
-      actionListWriteIndex_ = (actionListWriteIndex_ + 1) % ACTION_LIST_SIZE;
-      return true;
-    }
-    else
-      return false;
-  }
-
-
-  void WeaponManager::primaryFireRequest()
-  {
-    primaryFireRequest_ = true;
-  }
-
-
-  void WeaponManager::primaryFire()
-  {
-    currentState_ = PRIMARY_FIRE;
-
-    // TODO: add the name of the weapon manager. but for that,
-    // the factory is required.
-    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() * slots_[selectedWeapon_]->bulletSpeed_;
-    speed += node_->getWorldSpeed();
-
-	  temp->setScale(Vector3(1, 1, 1) * 10);
-	  temp->yaw(Degree(-90));
-
-	  bulletManager_->addBullet(new Bullet(temp, bulletEntity, speed));
-  
-    currentState_ = IDLE;
-  }
-
-
-  void WeaponManager::secondaryFireRequest()
-  {
-    secondaryFireRequest_ = true;
-  }
-
-  void WeaponManager::secondaryFire()
-  {
-  }
-
-
-  bool WeaponManager::tick(unsigned long time, Real deltaTime)
-  {
-    // return if no weapon has been added
-    if (!slots_[slotIndex_])
-      return true;
-
-    switch (currentState_)
-    {
-    case IDLE:
-      // first, process actions
-      if (actionList_[actionListReadIndex_] != NOTHING)
-      {
-        actionListReadIndex_ = (actionListReadIndex_ + 1) % ACTION_LIST_SIZE;
-        break;
-      }
-
-      switch (actionList_[actionListReadIndex_])
-      {
-      case RELOAD:
-        break;
-
-      case ZOOM_IN:
-        break;
-
-      case ZOOM_OUT:
-        break;
-
-      default:
-        break;
-      }
-
-      // secondly, execute firing
-      if (primaryFireRequest_)
-        primaryFire();
-      else if (secondaryFireRequest_)
-        secondaryFire();
-
-      break;
-
-    case PRIMARY_FIRE:
-      break;
-
-    case SECONDARY_FIRE:
-      break;
-
-    case RELOADING:
-      break;
-    }
-
-    primaryFireRequest_ = false;
-    secondaryFireRequest_ = false;
-
-    return true;
-  }
-
-
-  // static
-  bool WeaponManager::loadWeapons()
-  {
-    weaponList_s = new Weapon*[5];
-    for (int i = 0; i < 5; i++)
-      weaponList_s[i] = NULL;
-    weaponList_s[0] = new Weapon("Barrel Gun", 10, 2, 500);
-    return true;
-  }
-
-
-  // static
-  void WeaponManager::destroyWeapons()
-  {
-    if (weaponList_s)
-    {
-      for (int i = 0; i < 5; i++)
-        if (weaponList_s[i])
-          delete weaponList_s[i];
-      delete weaponList_s;
-    }
-  }
-
-}
-}
Index: code/branches/main_reto/src/weapon/weapon_manager.h
===================================================================
--- code/branches/main_reto/src/weapon/weapon_manager.h	(revision 266)
+++ 	(revision )
@@ -1,112 +1,0 @@
-/*
- *   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_MANAGER_H
-#define WEAPON_MANAGER_H
-
-#include "OgrePrerequisites.h"
-
-#include "orxonox_prerequisites.h"
-
-
-namespace orxonox {
-namespace weapon {
-
-  class WeaponManager
-  {
-  public:
-    enum Action {
-      NOTHING  = 0,
-      RELOAD   = 1,
-      ZOOM_IN  = 2,
-      ZOOM_OUT = 3
-    };
-
-  protected:
-    enum State {
-      IDLE = 0,
-      PRIMARY_FIRE = 1,
-      SECONDARY_FIRE = 2,
-      RELOADING = 4
-    };
-
-  public:
-    WeaponManager(Ogre::SceneManager*, InertialNode*, BulletManager*, int);
-	  virtual ~WeaponManager();
-
-    bool addWeapon(const Ogre::String&);
-
-    bool addAction(const Action);
-
-    void primaryFireRequest();
-
-    void secondaryFireRequest();
-
-    bool tick(unsigned long, Ogre::Real);
-
-    bool static loadWeapons();
-
-    void static destroyWeapons();
-
-  protected:
-    void primaryFire();
-
-    void secondaryFire();
-
-  public:
-
-  protected:
-    Ogre::SceneManager *sceneMgr_;
-    //Ogre::SceneNode *node_;
-    InertialNode* node_;
-
-    Weapon **slots_;
-    int slotSize_;
-    int slotIndex_;
-    int selectedWeapon_;
-
-    int bulletCounter_;
-    BulletManager *bulletManager_;
-
-    bool primaryFireRequest_;
-    bool secondaryFireRequest_;
-
-    State currentState_;
-
-    Action *actionList_;
-    int actionListReadIndex_;
-    int actionListWriteIndex_;
-
-    static Weapon **weaponList_s;
-
-  };
-
-}
-}
-
-#endif /* WEAPON_MANAGER_H */
Index: code/branches/main_reto/src/weapon/weapon_station.cc
===================================================================
--- code/branches/main_reto/src/weapon/weapon_station.cc	(revision 267)
+++ code/branches/main_reto/src/weapon/weapon_station.cc	(revision 267)
@@ -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/main_reto/src/weapon/weapon_station.h
===================================================================
--- code/branches/main_reto/src/weapon/weapon_station.h	(revision 267)
+++ code/branches/main_reto/src/weapon/weapon_station.h	(revision 267)
@@ -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 */
