[Orxonox-commit 6403] r11060 - in code/branches/cpp11_v3/src/orxonox: items worldentities/pawns

landauf at orxonox.net landauf at orxonox.net
Wed Jan 13 22:40:06 CET 2016


Author: landauf
Date: 2016-01-13 22:40:06 +0100 (Wed, 13 Jan 2016)
New Revision: 11060

Modified:
   code/branches/cpp11_v3/src/orxonox/items/ShipPart.cc
   code/branches/cpp11_v3/src/orxonox/items/ShipPart.h
   code/branches/cpp11_v3/src/orxonox/worldentities/pawns/Pawn.h
Log:
made some functions non-virtual

Modified: code/branches/cpp11_v3/src/orxonox/items/ShipPart.cc
===================================================================
--- code/branches/cpp11_v3/src/orxonox/items/ShipPart.cc	2016-01-13 21:19:21 UTC (rev 11059)
+++ code/branches/cpp11_v3/src/orxonox/items/ShipPart.cc	2016-01-13 21:40:06 UTC (rev 11060)
@@ -181,11 +181,6 @@
             return this->eventList_[index];
     }
 
-    void ShipPart::setDamageAbsorption(float value)
-    {
-        this->damageAbsorption_ = value;
-    }
-
     void ShipPart::setParent(ModularSpaceShip* ship)
     {
         this->parent_ = ship;
@@ -193,15 +188,6 @@
 
     /**
     @brief
-        Sets the health of the ShipPart.
-    */
-    void ShipPart::setHealth(float health)
-    {
-        this->health_ = health;
-    }
-
-    /**
-    @brief
         Handles a received hit.
     */
     void ShipPart::handleHit(float damage, float healthdamage, float shielddamage, Pawn* originator)

Modified: code/branches/cpp11_v3/src/orxonox/items/ShipPart.h
===================================================================
--- code/branches/cpp11_v3/src/orxonox/items/ShipPart.h	2016-01-13 21:19:21 UTC (rev 11059)
+++ code/branches/cpp11_v3/src/orxonox/items/ShipPart.h	2016-01-13 21:40:06 UTC (rev 11060)
@@ -63,20 +63,22 @@
             void addDestructionEvent(PartDestructionEvent* event);
             PartDestructionEvent* getDestructionEvent(unsigned int index);
 
-            virtual void setDamageAbsorption(float value);
-            inline float getDamageAbsorption()
+            inline void setDamageAbsorption(float value)
+                { this->damageAbsorption_ = value; }
+            inline float getDamageAbsorption() const
                 { return this->damageAbsorption_; }
 
             void setParent(ModularSpaceShip* ship);
-            inline ModularSpaceShip* getParent()
+            inline ModularSpaceShip* getParent() const
                 { return this->parent_; }
 
             inline void setEventExecution(bool var)
                 { this->eventExecution_ = var; }
-            inline bool isEventExecution()
+            inline bool isEventExecution() const
                 { return this->eventExecution_; }
 
-            virtual void setHealth(float health);
+            inline void setHealth(float health)
+                { this->health_ = health; }
             inline void addHealth(float health)
                 { this->setHealth(this->health_ + health); }
             inline void removeHealth(float health)

Modified: code/branches/cpp11_v3/src/orxonox/worldentities/pawns/Pawn.h
===================================================================
--- code/branches/cpp11_v3/src/orxonox/worldentities/pawns/Pawn.h	2016-01-13 21:19:21 UTC (rev 11059)
+++ code/branches/cpp11_v3/src/orxonox/worldentities/pawns/Pawn.h	2016-01-13 21:40:06 UTC (rev 11060)
@@ -70,7 +70,7 @@
                 { return this->bAlive_; }
 
 
-            virtual void setHealth(float health);
+            void setHealth(float health);
             inline void addHealth(float health)
                 { this->setHealth(this->health_ + health); }
             inline void removeHealth(float health)
@@ -88,7 +88,7 @@
             inline float getInitialHealth() const
                 { return this->initialHealth_; }
 
-            virtual void setShieldHealth(float shieldHealth);
+            void setShieldHealth(float shieldHealth);
 
             inline float getShieldHealth()
                 { return this->shieldHealth_; }
@@ -99,7 +99,7 @@
             inline bool hasShield()
                 { return (this->getShieldHealth() > 0); }
 
-            virtual void setMaxShieldHealth(float maxshieldhealth);
+            void setMaxShieldHealth(float maxshieldhealth);
             inline float getMaxShieldHealth() const
                 { return this->maxShieldHealth_; }
 
@@ -118,11 +118,11 @@
             inline float getShieldAbsorption()
                 { return this->shieldAbsorption_; }
 
-            virtual void setShieldRechargeRate(float shieldRechargeRate);
+            void setShieldRechargeRate(float shieldRechargeRate);
             inline float getShieldRechargeRate() const
                 { return this->shieldRechargeRate_; }
 
-            virtual void setShieldRechargeWaitTime(float shieldRechargeWaitTime);
+            void setShieldRechargeWaitTime(float shieldRechargeWaitTime);
             inline float getShieldRechargeWaitTime() const
                 { return this->shieldRechargeWaitTime_; }
 
@@ -132,7 +132,7 @@
             inline void startShieldRechargeCountdown()
                 { this->shieldRechargeWaitCountdown_ = this->getShieldRechargeWaitTime(); } // TODO: Implement in Projectile.cc
 
-            virtual void decreaseShieldRechargeCountdownTime(float dt);
+            void decreaseShieldRechargeCountdownTime(float dt);
 
             /** @brief Sets the state of the pawns vulnerability. @param bVulnerable */
             inline void setVulnerable(bool bVulnerable)
@@ -214,7 +214,7 @@
             void setExplosionSound(const std::string& engineSound);
             const std::string& getExplosionSound();
 
-            virtual const WeaponSystem* getWeaponSystem() const
+            inline const WeaponSystem* getWeaponSystem() const
                 { return this->weaponSystem_; }
 
         protected:




More information about the Orxonox-commit mailing list