[Orxonox-commit 5989] r10648 - in code/trunk: data/levels/includes src/orxonox/weaponsystem

fvultier at orxonox.net fvultier at orxonox.net
Mon Oct 12 18:28:15 CEST 2015


Author: fvultier
Date: 2015-10-12 18:28:15 +0200 (Mon, 12 Oct 2015)
New Revision: 10648

Modified:
   code/trunk/data/levels/includes/weaponSettingsAssff.oxi
   code/trunk/data/levels/includes/weaponSettingsAssff2.oxi
   code/trunk/src/orxonox/weaponsystem/WeaponSlot.cc
   code/trunk/src/orxonox/weaponsystem/WeaponSlot.h
Log:
Removed EnergyDrink Weapon from SpaceshipASSFF. Improved documentation of the WeaponSlot class.

Modified: code/trunk/data/levels/includes/weaponSettingsAssff.oxi
===================================================================
--- code/trunk/data/levels/includes/weaponSettingsAssff.oxi	2015-10-12 13:16:36 UTC (rev 10647)
+++ code/trunk/data/levels/includes/weaponSettingsAssff.oxi	2015-10-12 16:28:15 UTC (rev 10648)
@@ -24,7 +24,6 @@
             <Model mesh="hs-w01_reduced.mesh" roll="90" pitch="-76" yaw="-90" position="-1.5,1,0.3" scale=0.6 />
           </attached>
           <HsW01 mode=0 munitionpershot=0 delay=0.125 damage=3.14159 material="Flares/point_lensflare" muzzleoffset=" 0.1, 1.6,-2" />
-          <EnergyDrink mode=0 munitionpershot=0 delay=0  material="Flares/point_lensflare" muzzleoffset="2,-0.2,-1" />
           <HsW01 mode=0 munitionpershot=0 delay=0     damage=3.14159 material="Flares/point_lensflare" muzzleoffset="-1.6, 1.3,-2" />
           <LightningGun mode=1 muzzleoffset="0,0,0" damage=3.14159 shielddamage=20 />
         </Weapon>
@@ -43,12 +42,4 @@
           <RocketFire mode=3 muzzleoffset="0,0,0" damage=30 healthdamage=50 shielddamage=20 />
         </Weapon>
       </WeaponPack>
-      <WeaponPack>
-        <links>
-          <DefaultWeaponmodeLink firemode=1 weaponmode=0 />
-        </links>
-        <!--Weapon>
-          <EnergyDrink mode=0 munitionpershot=0 delay=0  material="Flares/point_lensflare"muzzleoffset="2,-0.2,-1" />
-        </Weapon-->
-      </WeaponPack>
     </weapons>

Modified: code/trunk/data/levels/includes/weaponSettingsAssff2.oxi
===================================================================
--- code/trunk/data/levels/includes/weaponSettingsAssff2.oxi	2015-10-12 13:16:36 UTC (rev 10647)
+++ code/trunk/data/levels/includes/weaponSettingsAssff2.oxi	2015-10-12 16:28:15 UTC (rev 10648)
@@ -44,12 +44,4 @@
           <RocketFire mode=3 muzzleoffset="0,0,0" damage=100 />
         </Weapon>
       </WeaponPack>
-      <WeaponPack>
-        <links>
-          <DefaultWeaponmodeLink firemode=1 weaponmode=0 />
-        </links>
-        <!--Weapon>
-          <EnergyDrink mode=0 munitionpershot=0 delay=0  material="Flares/point_lensflare"muzzleoffset="2,-0.2,-1" />
-        </Weapon-->
-      </WeaponPack>
     </weapons>

Modified: code/trunk/src/orxonox/weaponsystem/WeaponSlot.cc
===================================================================
--- code/trunk/src/orxonox/weaponsystem/WeaponSlot.cc	2015-10-12 13:16:36 UTC (rev 10647)
+++ code/trunk/src/orxonox/weaponsystem/WeaponSlot.cc	2015-10-12 16:28:15 UTC (rev 10648)
@@ -61,6 +61,10 @@
         // In the future, there might be parameters like allowed weapon types or max size of the weapon
     }
 
+    /**
+    @brief
+        Attaches the passed Weapon to this WeaponSlot. If this WeaponSlot is already occupied the old Weapon is removed and replaced by the new one.
+    */
     void WeaponSlot::attachWeapon(Weapon *weapon)
     {
         if (this->weapon_)
@@ -75,6 +79,10 @@
         }
     }
 
+    /**
+    @brief
+        Removes the attached weapon if there is any.
+    */
     void WeaponSlot::removeWeapon()
     {
         if (this->weapon_)

Modified: code/trunk/src/orxonox/weaponsystem/WeaponSlot.h
===================================================================
--- code/trunk/src/orxonox/weaponsystem/WeaponSlot.h	2015-10-12 13:16:36 UTC (rev 10647)
+++ code/trunk/src/orxonox/weaponsystem/WeaponSlot.h	2015-10-12 16:28:15 UTC (rev 10648)
@@ -34,24 +34,26 @@
 
 namespace orxonox
 {
-        /**
-        @brief
-            The a WeaponSlot defines where a @ref orxonox::Weapon "Weapon" is placed on a pawn. (A WeaponSlot is a StaticEntity)
-            In a WeaponSlot there can be only one "Weapon", but a Weapon can have several @ref orxonox::WeaponMode "WeaponModes".
-            A WeaponMode is what one intuitively imagines as weapon. (E.g. RocketFire, LightningGun, LaserFire are weaponmodes)
+    /**
+    @brief
+        The a WeaponSlot defines where a @ref orxonox::Weapon "Weapon" is placed on a pawn. (A WeaponSlot is a StaticEntity)
+        In a WeaponSlot there can be only one "Weapon", but a Weapon can have several @ref orxonox::WeaponMode "WeaponModes".
+        A WeaponMode is what one intuitively imagines as weapon. (E.g. RocketFire, LightningGun, LaserFire are weaponmodes)
 
-            A WeaponSlot is created in XML (in a weaponsettings file), which can be done in the following fashion:
-            @code
-            <weaponslots>
-              <WeaponSlot position="-15.0,-1.5,0" />
-              <WeaponSlot position=" 15.0,-1.5,0" />
-              <WeaponSlot position="    0,   0,0" />
-            </weaponslots>
+        A WeaponSlot is created in XML (in a weaponsettings file), which can be done in the following fashion:
+        @code
+        <weaponslots>
+          <WeaponSlot position="-15.0,-1.5,0" />
+          <WeaponSlot position=" 15.0,-1.5,0" />
+          <WeaponSlot position="    0,   0,0" />
+        </weaponslots>
 
-        @author
-            Martin Polak
+        A WeaponSlot can be attached to a @ref orxonox::Pawn because WeaponSlot inherits from @ref orxonox::StaticEntity.
 
-        @ingroup Weaponsystem
+    @author
+        Martin Polak
+
+    @ingroup Weaponsystem
     */
     class _OrxonoxExport WeaponSlot : public StaticEntity
     {
@@ -66,6 +68,10 @@
             Weapon * getWeapon() const
                 { return this->weapon_; }
 
+            /**
+            @brief
+                Checks whether there is a Weapon attached to this WeaponSlot.
+            */
             inline bool isOccupied() const
                 { return (this->weapon_ != 0); }
 
@@ -76,8 +82,8 @@
 
 
         private:
-            WeaponSystem * weaponSystem_;
-            Weapon * weapon_;
+            WeaponSystem * weaponSystem_; // Pointer to the WeaponSystem
+            Weapon * weapon_; // If the WeaponSlot is occupied a pointer to the attached Weapon is stored here.
     };
 }
 




More information about the Orxonox-commit mailing list