Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10648 for code/trunk/src


Ignore:
Timestamp:
Oct 12, 2015, 6:28:15 PM (9 years ago)
Author:
fvultier
Message:

Removed EnergyDrink Weapon from SpaceshipASSFF. Improved documentation of the WeaponSlot class.

Location:
code/trunk/src/orxonox/weaponsystem
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/orxonox/weaponsystem/WeaponSlot.cc

    r9667 r10648  
    6262    }
    6363
     64    /**
     65    @brief
     66        Attaches the passed Weapon to this WeaponSlot. If this WeaponSlot is already occupied the old Weapon is removed and replaced by the new one.
     67    */
    6468    void WeaponSlot::attachWeapon(Weapon *weapon)
    6569    {
     
    7680    }
    7781
     82    /**
     83    @brief
     84        Removes the attached weapon if there is any.
     85    */
    7886    void WeaponSlot::removeWeapon()
    7987    {
  • code/trunk/src/orxonox/weaponsystem/WeaponSlot.h

    r9667 r10648  
    3535namespace orxonox
    3636{
    37         /**
    38         @brief
    39             The a WeaponSlot defines where a @ref orxonox::Weapon "Weapon" is placed on a pawn. (A WeaponSlot is a StaticEntity)
    40             In a WeaponSlot there can be only one "Weapon", but a Weapon can have several @ref orxonox::WeaponMode "WeaponModes".
    41             A WeaponMode is what one intuitively imagines as weapon. (E.g. RocketFire, LightningGun, LaserFire are weaponmodes)
     37    /**
     38    @brief
     39        The a WeaponSlot defines where a @ref orxonox::Weapon "Weapon" is placed on a pawn. (A WeaponSlot is a StaticEntity)
     40        In a WeaponSlot there can be only one "Weapon", but a Weapon can have several @ref orxonox::WeaponMode "WeaponModes".
     41        A WeaponMode is what one intuitively imagines as weapon. (E.g. RocketFire, LightningGun, LaserFire are weaponmodes)
    4242
    43             A WeaponSlot is created in XML (in a weaponsettings file), which can be done in the following fashion:
    44             @code
    45             <weaponslots>
    46               <WeaponSlot position="-15.0,-1.5,0" />
    47               <WeaponSlot position=" 15.0,-1.5,0" />
    48               <WeaponSlot position="    0,   0,0" />
    49             </weaponslots>
     43        A WeaponSlot is created in XML (in a weaponsettings file), which can be done in the following fashion:
     44        @code
     45        <weaponslots>
     46          <WeaponSlot position="-15.0,-1.5,0" />
     47          <WeaponSlot position=" 15.0,-1.5,0" />
     48          <WeaponSlot position="    0,   0,0" />
     49        </weaponslots>
    5050
    51         @author
    52             Martin Polak
     51        A WeaponSlot can be attached to a @ref orxonox::Pawn because WeaponSlot inherits from @ref orxonox::StaticEntity.
    5352
    54         @ingroup Weaponsystem
     53    @author
     54        Martin Polak
     55
     56    @ingroup Weaponsystem
    5557    */
    5658    class _OrxonoxExport WeaponSlot : public StaticEntity
     
    6769                { return this->weapon_; }
    6870
     71            /**
     72            @brief
     73                Checks whether there is a Weapon attached to this WeaponSlot.
     74            */
    6975            inline bool isOccupied() const
    7076                { return (this->weapon_ != 0); }
     
    7783
    7884        private:
    79             WeaponSystem * weaponSystem_;
    80             Weapon * weapon_;
     85            WeaponSystem * weaponSystem_; // Pointer to the WeaponSystem
     86            Weapon * weapon_; // If the WeaponSlot is occupied a pointer to the attached Weapon is stored here.
    8187    };
    8288}
Note: See TracChangeset for help on using the changeset viewer.