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/Weapon.h

    r2893 r2912  
    3131
    3232#include "OrxonoxPrereqs.h"
     33#include "objects/worldentities/StaticEntity.h"
    3334
    34 #include "core/BaseObject.h"
    35 #include "tools/BillboardSet.h"
    3635#include "tools/Timer.h"
    3736#include "core/Identifier.h"
    38 
    39 #include "WeaponSystem.h"
    40 #include "Munition.h"
    41 
    42 #include "objects/worldentities/StaticEntity.h"
    4337
    4438namespace orxonox
     
    5347
    5448            virtual void fire();
    55             void attachNeededMunition(std::string munitionType);
    56             Munition * getAttachedMunition(std::string munitiontype);
     49            void attachNeededMunition(const std::string& munitionType);
     50            Munition * getAttachedMunition(const std::string& munitiontype);
    5751
    5852            //reloading
     
    6357
    6458            //XMLPort functions
    65             virtual void setMunitionType(std::string munitionType);
    66             virtual const std::string getMunitionType();
     59            virtual void setMunitionType(const std::string& munitionType);
     60            virtual const std::string& getMunitionType() const;
    6761            virtual void setBulletLoadingTime(float loadingTime);
    68             virtual const float getBulletLoadingTime();
     62            virtual const float getBulletLoadingTime() const;
    6963            virtual void setMagazineLoadingTime(float loadingTime);
    70             virtual const float getMagazineLoadingTime();
     64            virtual const float getMagazineLoadingTime() const;
    7165            virtual void setBulletAmount(unsigned int amount);
    72             virtual const unsigned int getBulletAmount();
     66            virtual const unsigned int getBulletAmount() const;
    7367            virtual void setMagazineAmount(unsigned int amount);
    74             virtual const unsigned int getMagazineAmount();
     68            virtual const unsigned int getMagazineAmount() const;
    7569            virtual void setUnlimitedMunition(bool unlimitedMunition);
    76             virtual const bool getUnlimitedMunition();
     70            virtual const bool getUnlimitedMunition() const;
    7771
    7872            //weapon actions
     
    8680            virtual void setWeapon();
    8781            virtual void setMunition();
    88            
    89             inline void setParentWeaponSystem(WeaponSystem *parentWeaponSystem)
    90                 { this->parentWeaponSystem_=parentWeaponSystem; };
    91             inline WeaponSystem * getParentWeaponSystem()
    92                 { return this->parentWeaponSystem_; };
     82
     83            inline void setWeaponSystem(WeaponSystem *weaponSystem)
     84                { this->weaponSystem_ = weaponSystem; };
     85            inline WeaponSystem * getWeaponSystem() const
     86                { return this->weaponSystem_; };
    9387
    9488            inline void setAttachedToWeaponSlot(WeaponSlot * wSlot)
    9589                { this->attachedToWeaponSlot_ = wSlot; }
    96             inline WeaponSlot * getAttachedToWeaponSlot()
     90            inline WeaponSlot * getAttachedToWeaponSlot() const
    9791                { return this->attachedToWeaponSlot_; }
    98 
    99 
    100         private:
    10192
    10293        protected:
     
    113104            WeaponSlot * attachedToWeaponSlot_;
    114105            Munition * munition_;
    115             WeaponSystem * parentWeaponSystem_;
     106            WeaponSystem * weaponSystem_;
    116107
    117108            SubclassIdentifier<Munition> munitionIdentifier_;
Note: See TracChangeset for help on using the changeset viewer.