Index: code/branches/main_reto/src/weapon/CMakeLists.txt
===================================================================
--- code/branches/main_reto/src/weapon/CMakeLists.txt	(revision 206)
+++ 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 206)
+++ 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 206)
+++ 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 206)
+++ 	(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 206)
+++ 	(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 206)
+++ 	(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 */
