Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 12, 2009, 5:05:18 PM (16 years ago)
Author:
polakma
Message:

now you can choose between shared munition and normal munition

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/weaponsystem/src/orxonox/objects/weaponSystem/WeaponSystem.cc

    r2710 r2778  
    3838
    3939
    40 /* WEAPONSYSTEM
    41  * creates the WeaponSystem and the ability to use weapons and munition
    42  * loads the weapon the whole weaponSystem setting from an xml file
     40/* WeaponSystem
    4341 *
     42 *  www.orxonox.net/wiki/WeaponSystem
    4443 */
    4544
     
    8483    }
    8584
    86     //returns the Pointer to the munitionType
     85    void WeaponSystem::setNewSharedMunition(std::string munitionType, Munition * munitionToAdd)
     86    {
     87        this->munitionSharedSet_[munitionType] = munitionToAdd;
     88    }
     89
     90    //returns the Pointer to the munitionType, if this munitionType doesn't exist returns 0, see Weapon::attachNeededMunition
    8791    Munition * WeaponSystem::getMunitionType(std::string munitionType)
    8892    {
    8993//COUT(0) << "WeaponSystem::getMunitionType " << munitionType << std::endl;
    90         std::map<std::string, Munition *>::const_iterator it = this->munitionSet_.find(munitionType);
    91         if (it != this->munitionSet_.end())
     94        std::map<std::string, Munition *>::const_iterator it = this->munitionSharedSet_.find(munitionType);
     95        if (it != this->munitionSharedSet_.end())
    9296            return it->second;
    9397        else
     
    96100
    97101
    98 /*
    99     //the first weaponSet is at n=0
    100     void WeaponSystem::setActiveWeaponSet(unsigned int n)
    101     {
    102         if (n < this->weaponSets_.size())
    103             this->activeWeaponSet_ = this->weaponSets_[n];
    104         else
    105             this->activeWeaponSet_ = this->weaponSets_[0];
    106     }
    107 */
     102
    108103
    109104
    110105    //n is the n'th weaponSet, starting with zero
    111     //SpaceShip.cc only needs to have the keybinding to a specific Set-number n
     106    //SpaceShip.cc only needs to have the keybinding to a specific Set-number n (=firemode)
    112107    void WeaponSystem::fire(WeaponMode::Enum n)
    113108    {
Note: See TracChangeset for help on using the changeset viewer.