Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 21, 2007, 12:44:02 AM (16 years ago)
Author:
rgrieder
Message:
  • modified the AmmunitionDump to hold different types of ammo
  • converted the RunManager into a Singleton
  • added some methods to address ammo by string
  • created a BaseWeapon class
  • derived BarrelGun from BaseWeapon
File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/main_reto_vs05/src/orxonox_ship.cc

    r198 r232  
    3434
    3535#include "inertial_node.h"
     36#include "run_manager.h"
    3637#include "weapon/bullet.h"
    3738#include "weapon/bullet_manager.h"
    3839#include "weapon/weapon_station.h"
    3940#include "weapon/base_weapon.h"
     41#include "weapon/barrel_gun.h"
    4042#include "weapon/ammunition_dump.h"
    4143
     
    6870  * @param mNode The scene node which the ship will be attached to later.
    6971  */
    70   OrxonoxShip::OrxonoxShip(SceneManager *sceneMgr, SceneNode *node,
    71         BulletManager *bulletManager)
    72               : sceneMgr_(sceneMgr),
    73         baseThrust_(1000), currentThrust_(Vector3::ZERO),
    74         objectCounter_(0), bulletManager_(bulletManager)
     72  OrxonoxShip::OrxonoxShip(SceneNode *node)
     73    : sceneMgr_(RunManager::getSingletonPtr()->getSceneManagerPtr()),
     74      bulletManager_(RunManager::getSingletonPtr()->getBulletManagerPtr()),
     75      baseThrust_(1000), currentThrust_(Vector3::ZERO), objectCounter_(0)
    7576  {
    7677    rootNode_ = new InertialNode(node, Vector3::ZERO);
     
    115116
    116117    // initialise weapon(s)
    117     ammoDump_ = new AmmunitionDump(420);
    118     ammoDump_->store(420);
     118    ammoDump_ = new AmmunitionDump();
     119    ammoDump_->setDumpSize("Barrel", 1000);
     120    ammoDump_->store("Barrel", 420);
    119121
    120122    InertialNode *mainWeaponNode = rootNode_->createChildNode();
    121     mainWeapon_ = new BaseWeapon(sceneMgr_, mainWeaponNode,
    122           bulletManager_, ammoDump_);
     123    mainWeapon_ = new BarrelGun(mainWeaponNode, ammoDump_);
    123124
    124125    railGunStation_ = new WeaponStation(4);
     
    216217  int OrxonoxShip::getAmmoStock()
    217218  {
    218     return ammoDump_->getStockSize();
     219    return ammoDump_->getStockSize("Barrel");
    219220  }
    220221
Note: See TracChangeset for help on using the changeset viewer.