Index: code/branches/main_reto_vs05/bin/Debug/ogre.cfg
===================================================================
--- code/branches/main_reto_vs05/bin/Debug/ogre.cfg	(revision 195)
+++ code/branches/main_reto_vs05/bin/Debug/ogre.cfg	(revision 198)
@@ -3,5 +3,5 @@
 [Direct3D9 Rendering Subsystem]
 Allow NVPerfHUD=No
-Anti aliasing=Level 4
+Anti aliasing=Level 2
 Floating-point mode=Fastest
 Full Screen=No
Index: code/branches/main_reto_vs05/scripts/weapon_framework.vcproj
===================================================================
--- code/branches/main_reto_vs05/scripts/weapon_framework.vcproj	(revision 195)
+++ code/branches/main_reto_vs05/scripts/weapon_framework.vcproj	(revision 198)
@@ -41,5 +41,5 @@
 				Name="VCCLCompilerTool"
 				Optimization="0"
-				AdditionalIncludeDirectories="..\src;..\src\weapon;&quot;$(OGRE_HOME)\OgreMain\include&quot;;&quot;$(OGRE_HOME)\Dependencies\include&quot;"
+				AdditionalIncludeDirectories="..\src;&quot;$(OGRE_HOME)\OgreMain\include&quot;;&quot;$(OGRE_HOME)\Dependencies\include&quot;"
 				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS"
 				MinimalRebuild="true"
@@ -120,5 +120,5 @@
 			<Tool
 				Name="VCCLCompilerTool"
-				AdditionalIncludeDirectories="..\src;..\src\weapon;&quot;$(OGRE_HOME)\OgreMain\include&quot;;&quot;$(OGRE_HOME)\Dependencies\include&quot;"
+				AdditionalIncludeDirectories="..\src;&quot;$(OGRE_HOME)\OgreMain\include&quot;;&quot;$(OGRE_HOME)\Dependencies\include&quot;"
 				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
 				RuntimeLibrary="2"
@@ -223,4 +223,8 @@
 				</File>
 				<File
+					RelativePath="..\src\weapon\base_weapon.cpp"
+					>
+				</File>
+				<File
 					RelativePath="..\src\weapon\bullet.cc"
 					>
@@ -231,5 +235,5 @@
 				</File>
 				<File
-					RelativePath="..\src\weapon\weapon_manager.cc"
+					RelativePath="..\src\weapon\weapon_station.cc"
 					>
 				</File>
@@ -281,4 +285,8 @@
 				</File>
 				<File
+					RelativePath="..\src\weapon\base_weapon.h"
+					>
+				</File>
+				<File
 					RelativePath="..\src\weapon\bullet.h"
 					>
@@ -293,5 +301,5 @@
 				</File>
 				<File
-					RelativePath="..\src\weapon\weapon_manager.h"
+					RelativePath="..\src\weapon\weapon_station.h"
 					>
 				</File>
Index: code/branches/main_reto_vs05/src/orxonox_prerequisites.h
===================================================================
--- code/branches/main_reto_vs05/src/orxonox_prerequisites.h	(revision 195)
+++ code/branches/main_reto_vs05/src/orxonox_prerequisites.h	(revision 198)
@@ -46,6 +46,6 @@
     class Bullet;
     class BulletManager;
-    class Weapon;
-    class WeaponManager;
+    class BaseWeapon;
+    class WeaponStation;
 
   }
Index: code/branches/main_reto_vs05/src/orxonox_scene.cc
===================================================================
--- code/branches/main_reto_vs05/src/orxonox_scene.cc	(revision 195)
+++ code/branches/main_reto_vs05/src/orxonox_scene.cc	(revision 198)
@@ -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_vs05/src/orxonox_ship.cc
===================================================================
--- code/branches/main_reto_vs05/src/orxonox_ship.cc	(revision 195)
+++ code/branches/main_reto_vs05/src/orxonox_ship.cc	(revision 198)
@@ -36,5 +36,7 @@
 #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/ammunition_dump.h"
 
 #include "orxonox_ship.h"
@@ -68,7 +70,7 @@
   OrxonoxShip::OrxonoxShip(SceneManager *sceneMgr, SceneNode *node,
         BulletManager *bulletManager)
-	      : sceneMgr_(sceneMgr), //currentSpeed_(Vector3(0, 0, 0)),
+	      : sceneMgr_(sceneMgr),
         baseThrust_(1000), currentThrust_(Vector3::ZERO),
-        objectCounter_(0), bulletManager_(bulletManager)//, bulletSpeed_(400)
+        objectCounter_(0), bulletManager_(bulletManager)
   {
     rootNode_ = new InertialNode(node, Vector3::ZERO);
@@ -84,4 +86,6 @@
     if (mainWeapon_)
       delete mainWeapon_;
+    if (railGunStation_)
+      delete railGunStation_;
     if (rootNode_)
       delete rootNode_;
@@ -111,8 +115,14 @@
 
     // initialise weapon(s)
+    ammoDump_ = new AmmunitionDump(420);
+    ammoDump_->store(420);
+
     InertialNode *mainWeaponNode = rootNode_->createChildNode();
-    mainWeapon_ = new WeaponManager(sceneMgr_, mainWeaponNode,
-          bulletManager_, 1);
-    mainWeapon_->addWeapon("Barrel Gun");
+    mainWeapon_ = new BaseWeapon(sceneMgr_, mainWeaponNode,
+          bulletManager_, ammoDump_);
+
+    railGunStation_ = new WeaponStation(4);
+    railGunStation_->addWeapon(mainWeapon_);
+    railGunStation_->selectWeapon(0);
 
 	  return true;
@@ -198,7 +208,13 @@
   * @return Bullet containing speed and entity.
   */
-  WeaponManager* OrxonoxShip::getMainWeapon()
+  BaseWeapon* OrxonoxShip::getMainWeapon()
   {
     return mainWeapon_;
+  }
+
+
+  int OrxonoxShip::getAmmoStock()
+  {
+    return ammoDump_->getStockSize();
   }
 
Index: code/branches/main_reto_vs05/src/orxonox_ship.h
===================================================================
--- code/branches/main_reto_vs05/src/orxonox_ship.h	(revision 195)
+++ code/branches/main_reto_vs05/src/orxonox_ship.h	(revision 198)
@@ -54,5 +54,7 @@
     Ogre::Vector3 getSpeed();
 
-    weapon::WeaponManager* getMainWeapon();
+    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_vs05/src/run_manager.cc
===================================================================
--- code/branches/main_reto_vs05/src/run_manager.cc	(revision 195)
+++ code/branches/main_reto_vs05/src/run_manager.cc	(revision 198)
@@ -56,5 +56,5 @@
 #include "weapon/bullet.h"
 #include "weapon/bullet_manager.h"
-#include "weapon/weapon_manager.h"
+#include "weapon/base_weapon.h"
 
 #include "run_manager.h"
@@ -108,5 +108,4 @@
     // create a bullet manager
     bulletManager_ = new BulletManager(sceneMgr_);
-    WeaponManager::loadWeapons();
 
 
@@ -213,6 +212,4 @@
     if (bulletManager_)
       delete bulletManager_;
-
-    WeaponManager::destroyWeapons();
   }
 
@@ -352,5 +349,5 @@
 
     if (keyboard_->isKeyDown(KC_G))
-      playerShip_->getMainWeapon()->addAction(WeaponManager::RELOAD);
+      playerShip_->getMainWeapon()->addAction(BaseWeapon::RELOAD);
 
     if( keyboard_->isKeyDown(KC_ESCAPE) || keyboard_->isKeyDown(KC_Q) )
@@ -421,5 +418,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: "
Index: code/branches/main_reto_vs05/src/weapon/ammunition_dump.cc
===================================================================
--- code/branches/main_reto_vs05/src/weapon/ammunition_dump.cc	(revision 195)
+++ code/branches/main_reto_vs05/src/weapon/ammunition_dump.cc	(revision 198)
@@ -32,5 +32,6 @@
 namespace weapon {
 
-  AmmunitionDump::AmmunitionDump()
+  AmmunitionDump::AmmunitionDump(int capacity)
+        : stock_(0), capacity_(capacity)
   {
   }
@@ -41,4 +42,33 @@
   }
 
+  
+  void AmmunitionDump::store(int quantity)
+  {
+    stock_ += quantity;
+    if (stock_ > capacity_)
+      stock_ = capacity_;
+  }
+
+
+  int AmmunitionDump::getAmmunition(int quantity)
+  {
+    if (stock_ >= quantity)
+    {
+      stock_ -= quantity;
+      return quantity;
+    }
+    else
+    {
+      quantity = stock_;
+      stock_ = 0;
+      return quantity;
+    }
+  }
+
+
+  int AmmunitionDump::getStockSize()
+  {
+    return stock_;
+  }
 }
 }
Index: code/branches/main_reto_vs05/src/weapon/ammunition_dump.h
===================================================================
--- code/branches/main_reto_vs05/src/weapon/ammunition_dump.h	(revision 195)
+++ code/branches/main_reto_vs05/src/weapon/ammunition_dump.h	(revision 198)
@@ -41,8 +41,16 @@
   {
   public:
-	  AmmunitionDump();
+	  AmmunitionDump(int capacity);
 	  ~AmmunitionDump();
 
+    void store(int quantiy);
+
+    int getAmmunition(int quantity);
+
+    int getStockSize();
+
   protected:
+    int stock_;
+    int capacity_;
 
   protected:
Index: code/branches/main_reto_vs05/src/weapon/base_weapon.cpp
===================================================================
--- code/branches/main_reto_vs05/src/weapon/base_weapon.cpp	(revision 198)
+++ code/branches/main_reto_vs05/src/weapon/base_weapon.cpp	(revision 198)
@@ -0,0 +1,250 @@
+/*
+ *   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"
+
+
+namespace orxonox {
+namespace weapon {
+  using namespace Ogre;
+
+  BaseWeapon::BaseWeapon(SceneManager *sceneMgr, InertialNode *node,
+        BulletManager *bulletManager, AmmunitionDump *ammoDump)
+        : sceneMgr_(sceneMgr), node_(node),
+        bulletCounter_(0), primaryFireRequest_(false), currentState_(IDLE),
+        secondaryFireRequest_(false),
+        bulletManager_(bulletManager), secondaryFired_(false),
+        timeSinceNextActionAdded_(0), actionAdded_(false), nextAction_(NOTHING),
+        name_("Base Weapon"), primaryFirePower_(100), secondaryFirePower_(500),
+        primaryFiringRate_(10), secondaryFiringRate_(2), primaryBulletSpeed_(1000),
+        secondaryBulletSpeed_(500), magazineSize_(25), ammoDump_(ammoDump)
+  {
+    leftAmmo_ = ammoDump_->getAmmunition(magazineSize_);
+  }
+
+
+  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::primaryFire()
+  {
+    if (leftAmmo_ < 1)
+    {
+      currentState_ = IDLE;
+      return;
+    }
+
+    SceneNode *temp = sceneMgr_->getRootSceneNode()->createChildSceneNode(
+          node_->getSceneNode()->getWorldPosition(),
+          node_->getSceneNode()->getWorldOrientation());
+
+    Entity* bulletEntity = sceneMgr_->createEntity("BulletEntity"
+          + StringConverter::toString(bulletCounter_++), "Barrel.mesh");
+
+    Vector3 speed = (temp->getOrientation() * Vector3(0, 0, -1))
+          .normalisedCopy() * primaryBulletSpeed_;
+    speed += node_->getWorldSpeed();
+
+	  temp->setScale(Vector3(1, 1, 1) * 4);
+	  temp->yaw(Degree(-90));
+
+	  bulletManager_->addBullet(new Bullet(temp, bulletEntity, speed));
+
+    --leftAmmo_;
+  }
+
+
+  void BaseWeapon::primaryFiring(unsigned int time)
+  {
+    if (time > 100)
+    {
+      currentState_ = IDLE;
+    }
+  }
+
+
+  void BaseWeapon::secondaryFireRequest()
+  {
+    secondaryFireRequest_ = true;
+  }
+
+
+  void BaseWeapon::secondaryFire()
+  {
+    if (leftAmmo_ < 5)
+    {
+      currentState_ = IDLE;
+      return;
+    }
+
+    SceneNode *temp = sceneMgr_->getRootSceneNode()->createChildSceneNode(
+          node_->getSceneNode()->getWorldPosition(),
+          node_->getSceneNode()->getWorldOrientation());
+
+    Entity* bulletEntity = sceneMgr_->createEntity("BulletEntity"
+          + StringConverter::toString(bulletCounter_++), "Barrel.mesh");
+
+    Vector3 speed = (temp->getOrientation() * Vector3(0, 0, -1))
+          .normalisedCopy() * secondaryBulletSpeed_*0.5;
+    speed += node_->getWorldSpeed();
+
+	  temp->setScale(Vector3(1, 1, 1) * 10);
+	  temp->yaw(Degree(-90));
+
+	  bulletManager_->addBullet(new Bullet(temp, bulletEntity, speed));
+
+    leftAmmo_ -= 5;
+  }
+
+
+  void BaseWeapon::secondaryFiring(unsigned int time)
+  {
+    if (time > 250)
+      currentState_ = IDLE;
+  }
+
+
+  bool BaseWeapon::tick(unsigned long time, Real deltaTime)
+  {
+    // process action adder
+    if (actionAdded_)
+    {
+      timeSinceNextActionAdded_ = time;
+      actionAdded_ = false;
+    }
+
+    switch (currentState_)
+    {
+    case IDLE:
+      // first, process next action
+      if (nextAction_ != NOTHING)
+      {
+        actionStartTime_ = time;
+        switch (nextAction_)
+        {
+        case RELOAD:
+          leftAmmo_ += ammoDump_->getAmmunition(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();
+        }
+      }
+
+      break;
+
+    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;
+    }
+
+    primaryFireRequest_ = false;
+    secondaryFireRequest_ = false;
+
+    if (time - timeSinceNextActionAdded_ > nextActionValidityPeriod_)
+      nextAction_ = NOTHING;
+
+    return true;
+  }
+
+
+  int BaseWeapon::getAmmoState()
+  {
+    return leftAmmo_;
+  }
+}
+}
Index: code/branches/main_reto_vs05/src/weapon/base_weapon.h
===================================================================
--- code/branches/main_reto_vs05/src/weapon/base_weapon.h	(revision 198)
+++ code/branches/main_reto_vs05/src/weapon/base_weapon.h	(revision 198)
@@ -0,0 +1,125 @@
+/*
+ *   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(Ogre::SceneManager*, InertialNode*, BulletManager*,
+          AmmunitionDump*);
+	  virtual ~BaseWeapon();
+
+    bool addAction(const Action);
+
+    void primaryFireRequest();
+
+    void secondaryFireRequest();
+
+    int getAmmoState();
+
+    bool tick(unsigned long, Ogre::Real);
+
+  protected:
+    void primaryFire();
+
+    void primaryFiring(unsigned int);
+
+    void secondaryFire();
+
+    void secondaryFiring(unsigned int);
+
+  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_vs05/src/weapon/weapon.h
===================================================================
--- code/branches/main_reto_vs05/src/weapon/weapon.h	(revision 195)
+++ code/branches/main_reto_vs05/src/weapon/weapon.h	(revision 198)
@@ -26,4 +26,5 @@
  */
 
+#if 0
 
 #ifndef WEAPON_H
@@ -42,7 +43,7 @@
   public:
     Weapon(const Ogre::String &name, int firePower, int firingRate,
-      Ogre::Real bulletSpeed)
+      Ogre::Real bulletSpeed, int magazineSize)
           : name_(name), firePower_(firePower), firingRate_(firingRate),
-          bulletSpeed_(bulletSpeed) { }
+          bulletSpeed_(bulletSpeed), magazineSize_(magazineSize) { }
 
     virtual ~Weapon() { }
@@ -53,4 +54,5 @@
     int firingRate_;
     Ogre::Real bulletSpeed_;
+    int magazineSize_;
   };
 
@@ -59,2 +61,4 @@
 
 #endif /* WEAPON_H */
+
+#endif
Index: code/branches/main_reto_vs05/src/weapon/weapon_manager.cc
===================================================================
--- code/branches/main_reto_vs05/src/weapon/weapon_manager.cc	(revision 195)
+++ 	(revision )
@@ -1,274 +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), secondaryFired_(false),
-        timeSinceNextActionAdded_(0), actionAdded_(false), nextAction_(NOTHING)
-  {
-  	slots_ = new Weapon*[slotSize];
-  }
-
-
-  WeaponManager::~WeaponManager()
-  {
-    if (slots_)
-      delete slots_;
-  }
-
-
-  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 (nextAction_ != NOTHING)
-    {
-      nextAction_ = act;
-      actionAdded_ = true;
-      return true;
-    }
-    else
-      return false;
-  }
-
-
-  void WeaponManager::primaryFireRequest()
-  {
-    primaryFireRequest_ = true;
-  }
-
-
-  void WeaponManager::primaryFire()
-  {
-    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) * 4);
-	  temp->yaw(Degree(-90));
-
-	  bulletManager_->addBullet(new Bullet(temp, bulletEntity, speed));
-  }
-
-
-  void WeaponManager::primaryFiring(unsigned int time)
-  {
-    if (time > 100)
-    {
-      currentState_ = IDLE;
-    }
-  }
-
-
-  void WeaponManager::secondaryFireRequest()
-  {
-    secondaryFireRequest_ = true;
-  }
-
-
-  void WeaponManager::secondaryFire()
-  {
-    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_*0.5;
-    speed += node_->getWorldSpeed();
-
-	  temp->setScale(Vector3(1, 1, 1) * 10);
-	  temp->yaw(Degree(-90));
-
-	  bulletManager_->addBullet(new Bullet(temp, bulletEntity, speed));
-  }
-
-
-  void WeaponManager::secondaryFiring(unsigned int time)
-  {
-    if (time > 250)
-      currentState_ = IDLE;
-  }
-
-
-  bool WeaponManager::tick(unsigned long time, Real deltaTime)
-  {
-    // return if no weapon has been added
-    if (!slots_[slotIndex_])
-      return true;
-
-    // process action adder
-    if (actionAdded_)
-    {
-      timeSinceNextActionAdded_ = time;
-      actionAdded_ = false;
-    }
-
-    switch (currentState_)
-    {
-    case IDLE:
-      // first, process next action
-      if (nextAction_ != NOTHING)
-      {
-        actionStartTime_ = time;
-        switch (nextAction_)
-        {
-        case RELOAD:
-          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();
-        }
-      }
-
-      break;
-
-    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;
-    }
-
-    primaryFireRequest_ = false;
-    secondaryFireRequest_ = false;
-
-    if (time - timeSinceNextActionAdded_ > nextActionValidityPeriod_)
-      nextAction_ = NOTHING;
-
-    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, 1000);
-    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_vs05/src/weapon/weapon_manager.h
===================================================================
--- code/branches/main_reto_vs05/src/weapon/weapon_manager.h	(revision 195)
+++ 	(revision )
@@ -1,121 +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,
-      CHANGE_AMMO  = 2,
-      SPECIAL  = 3
-    };
-
-  protected:
-    enum State {
-      IDLE = 0,
-      PRIMARY_FIRE = 1,
-      SECONDARY_FIRE = 2,
-      RELOADING = 3,
-      CHANGING_AMMO = 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 primaryFiring(unsigned int);
-
-    void secondaryFire();
-
-    void secondaryFiring(unsigned int);
-
-  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_;
-
-    unsigned long actionStartTime_;
-
-    State currentState_;
-    bool secondaryFired_;
-
-    Action nextAction_;
-    bool actionAdded_;
-    unsigned long timeSinceNextActionAdded_;
-    static const unsigned long nextActionValidityPeriod_ = 500;
-
-    static Weapon **weaponList_s;
-
-  };
-
-}
-}
-
-#endif /* WEAPON_MANAGER_H */
Index: code/branches/main_reto_vs05/src/weapon/weapon_station.cc
===================================================================
--- code/branches/main_reto_vs05/src/weapon/weapon_station.cc	(revision 198)
+++ code/branches/main_reto_vs05/src/weapon/weapon_station.cc	(revision 198)
@@ -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_vs05/src/weapon/weapon_station.h
===================================================================
--- code/branches/main_reto_vs05/src/weapon/weapon_station.h	(revision 198)
+++ code/branches/main_reto_vs05/src/weapon/weapon_station.h	(revision 198)
@@ -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 */
