Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 12, 2009, 12:34:55 AM (15 years ago)
Author:
landauf
Message:
  • switched back to std::vector for the WeaponSlots to keep them in the same order as in the XML file
  • added DefaultWeaponmodeLink, a class which links weaponmodes (a property of a Weapon or a WeaponPack) with firemodes (one firemode corresponds to one WeaponSet). This can be changed later (for example in a nice GUI), but DefaultWeaponmodeLink defines the default value.
File:
1 edited

Legend:

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

    r2914 r2915  
    5050
    5151            void addWeapon(Weapon * weapon);
     52            void removeWeapon(Weapon * weapon);
    5253            Weapon * getWeapon(unsigned int index) const;
    5354
     
    5556                { return this->weapons_.size(); }
    5657
    57             unsigned int getDesiredWeaponmode(unsigned int firemode) { return 0; } // TODO
     58            void addDefaultWeaponmodeLink(DefaultWeaponmodeLink* link);
     59            DefaultWeaponmodeLink* getDefaultWeaponmodeLink(unsigned int index) const;
    5860
    59             void attachNeededMunitionToAllWeapons();
     61            unsigned int getDesiredWeaponmode(unsigned int firemode) const;
    6062
    6163            inline void setWeaponSystem(WeaponSystem *weaponSystem)
    62                 { this->weaponSystem_ = weaponSystem; this->setWeaponSystemToAllWeapons(weaponSystem); }
     64            {
     65                this->weaponSystem_ = weaponSystem;
     66                this->setWeaponSystemToAllWeapons();
     67                this->attachNeededMunitionToAllWeapons();
     68            }
    6369            inline WeaponSystem * getWeaponSystem() const
    6470                { return this->weaponSystem_; }
    6571
    6672        private:
    67             void setWeaponSystemToAllWeapons(WeaponSystem * weaponSystem);
     73            void setWeaponSystemToAllWeapons();
     74            void attachNeededMunitionToAllWeapons();
    6875
    6976            std::set<Weapon *> weapons_;
     77            std::set<DefaultWeaponmodeLink *> links_;
    7078            WeaponSystem * weaponSystem_;
    7179    };
Note: See TracChangeset for help on using the changeset viewer.