Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 9, 2009, 3:18:11 AM (15 years ago)
Author:
landauf
Message:

Several small adjustments in the weaponsystem (like additional const keyword, includes moved from .h to .cc where possible, …)

Firemode is now an unsigned int instead of an Enum. Instead of "fire" and "altFire" use "fire 0" and "fire 1"

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/weapons/src/orxonox/objects/weaponSystem/WeaponPack.h

    r2893 r2912  
    3333#include "OrxonoxPrereqs.h"
    3434
     35#include <vector>
     36
    3537#include "core/BaseObject.h"
    36 
    37 #include "Weapon.h"
    38 
    3938
    4039namespace orxonox
     
    5049            void fire();
    5150
    52             Weapon * getWeaponPointer(unsigned int n);
    53             int getSize();
     51            Weapon * getWeaponPointer(unsigned int n) const;
     52            int getSize() const;
    5453
    5554            void setFireMode(unsigned int firemode);
    56             unsigned int getFireMode();
     55            unsigned int getFireMode() const;
    5756
    5857            void addWeapon(Weapon * weapon);
    59             const Weapon * getWeapon(unsigned int index);
     58            const Weapon * getWeapon(unsigned int index) const;
     59
     60            void attachNeededMunitionToAllWeapons();
    6061
    6162            //functions with effect to all weapons of the weaponPack
    6263            //functions needed for creating Pointer to the right objects (-->Pawn.cc)
    63             void setParentWeaponSystemToAllWeapons(WeaponSystem * weaponSystem);
    64             void attachNeededMunitionToAllWeapons();
    65 
    66             inline void setParentWeaponSystem(WeaponSystem *parentWeaponSystem)
    67                 { parentWeaponSystem_=parentWeaponSystem; }
    68             inline WeaponSystem * getParentWeaponSystem()
    69                 { return parentWeaponSystem_; }
     64            inline void setWeaponSystem(WeaponSystem *weaponSystem)
     65                { this->weaponSystem_ = weaponSystem; this->setWeaponSystemToAllWeapons(weaponSystem); }
     66            inline WeaponSystem * getWeaponSystem() const
     67                { return this->weaponSystem_; }
    7068
    7169        private:
     70            void setWeaponSystemToAllWeapons(WeaponSystem * weaponSystem);
     71
    7272            std::vector<Weapon *> weapons_;
    73             WeaponSystem *parentWeaponSystem_;
     73            WeaponSystem *weaponSystem_;
    7474            unsigned int firemode_;
    7575    };
Note: See TracChangeset for help on using the changeset viewer.