Changeset 10648 for code/trunk/src/orxonox
- Timestamp:
- Oct 12, 2015, 6:28:15 PM (9 years ago)
- Location:
- code/trunk/src/orxonox/weaponsystem
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/orxonox/weaponsystem/WeaponSlot.cc
r9667 r10648 62 62 } 63 63 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 */ 64 68 void WeaponSlot::attachWeapon(Weapon *weapon) 65 69 { … … 76 80 } 77 81 82 /** 83 @brief 84 Removes the attached weapon if there is any. 85 */ 78 86 void WeaponSlot::removeWeapon() 79 87 { -
code/trunk/src/orxonox/weaponsystem/WeaponSlot.h
r9667 r10648 35 35 namespace orxonox 36 36 { 37 38 39 40 41 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) 42 42 43 44 45 46 47 48 49 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> 50 50 51 @author 52 Martin Polak 51 A WeaponSlot can be attached to a @ref orxonox::Pawn because WeaponSlot inherits from @ref orxonox::StaticEntity. 53 52 54 @ingroup Weaponsystem 53 @author 54 Martin Polak 55 56 @ingroup Weaponsystem 55 57 */ 56 58 class _OrxonoxExport WeaponSlot : public StaticEntity … … 67 69 { return this->weapon_; } 68 70 71 /** 72 @brief 73 Checks whether there is a Weapon attached to this WeaponSlot. 74 */ 69 75 inline bool isOccupied() const 70 76 { return (this->weapon_ != 0); } … … 77 83 78 84 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. 81 87 }; 82 88 }
Note: See TracChangeset
for help on using the changeset viewer.