[Orxonox-commit 4642] r9313 - in code/branches/presentation2012merge/src/modules/pickup: . items

landauf at orxonox.net landauf at orxonox.net
Sun Jul 8 17:33:03 CEST 2012


Author: landauf
Date: 2012-07-08 17:33:03 +0200 (Sun, 08 Jul 2012)
New Revision: 9313

Modified:
   code/branches/presentation2012merge/src/modules/pickup/Pickup.cc
   code/branches/presentation2012merge/src/modules/pickup/Pickup.h
   code/branches/presentation2012merge/src/modules/pickup/items/DronePickup.cc
   code/branches/presentation2012merge/src/modules/pickup/items/MetaPickup.cc
Log:
found some more functions to rename

Modified: code/branches/presentation2012merge/src/modules/pickup/Pickup.cc
===================================================================
--- code/branches/presentation2012merge/src/modules/pickup/Pickup.cc	2012-07-08 15:26:04 UTC (rev 9312)
+++ code/branches/presentation2012merge/src/modules/pickup/Pickup.cc	2012-07-08 15:33:03 UTC (rev 9313)
@@ -101,8 +101,8 @@
     {
         SUPER(Pickup, XMLPort, xmlelement, mode);
 
-        XMLPortParam(Pickup, "activationType", setActivationType, getActivationType, xmlelement, mode);
-        XMLPortParam(Pickup, "durationType", setDurationType, getDurationType, xmlelement, mode);
+        XMLPortParam(Pickup, "activationType", setActivationTypeAsString, getActivationTypeAsString, xmlelement, mode);
+        XMLPortParam(Pickup, "durationType", setDurationTypeAsString, getDurationTypeAsString, xmlelement, mode);
 
         this->initializeIdentifier();
     }
@@ -113,9 +113,9 @@
     @return
         Returns a string containing the activation type.
     */
-    const std::string& Pickup::getActivationType(void) const
+    const std::string& Pickup::getActivationTypeAsString(void) const
     {
-        switch(this->activationType_)
+        switch(this->getActivationType())
         {
             case pickupActivationType::immediate:
                 return activationTypeImmediate_s;
@@ -132,9 +132,9 @@
     @return
         Returns a string containing the duration type.
     */
-    const std::string& Pickup::getDurationType(void) const
+    const std::string& Pickup::getDurationTypeAsString(void) const
     {
-        switch(this->durationType_)
+        switch(this->getDurationType())
         {
             case pickupDurationType::once:
                 return durationTypeOnce_s;
@@ -151,12 +151,12 @@
     @param type
         The activation type of the Pickup as a string.
     */
-    void Pickup::setActivationType(const std::string& type)
+    void Pickup::setActivationTypeAsString(const std::string& type)
     {
         if(type == Pickup::activationTypeImmediate_s)
-            this->activationType_ = pickupActivationType::immediate;
+            this->setActivationType(pickupActivationType::immediate);
         else if(type == Pickup::activationTypeOnUse_s)
-            this->activationType_ = pickupActivationType::onUse;
+            this->setActivationType(pickupActivationType::onUse);
         else
             orxout(internal_error, context::pickups) << "Invalid activationType '" << type << "' in " << this->getIdentifier()->getName() << "." << endl;
     }
@@ -167,12 +167,12 @@
     @param type
         The duration type of the Pickup as a string.
     */
-    void Pickup::setDurationType(const std::string& type)
+    void Pickup::setDurationTypeAsString(const std::string& type)
     {
         if(type == Pickup::durationTypeOnce_s)
-            this->durationType_ = pickupDurationType::once;
+            this->setDurationType(pickupDurationType::once);
         else if(type == Pickup::durationTypeContinuous_s)
-            this->durationType_ = pickupDurationType::continuous;
+            this->setDurationType(pickupDurationType::continuous);
         else
             orxout(internal_error, context::pickups) << "Invalid durationType '" << type << "' in " << this->getIdentifier()->getName() << "." << endl;
     }
@@ -205,8 +205,8 @@
         SUPER(Pickup, clone, item);
 
         Pickup* pickup = orxonox_cast<Pickup*>(item);
-        pickup->setActivationTypeDirect(this->getActivationTypeDirect());
-        pickup->setDurationTypeDirect(this->getDurationTypeDirect());
+        pickup->setActivationType(this->getActivationType());
+        pickup->setDurationType(this->getDurationType());
 
         pickup->initializeIdentifier();
     }

Modified: code/branches/presentation2012merge/src/modules/pickup/Pickup.h
===================================================================
--- code/branches/presentation2012merge/src/modules/pickup/Pickup.h	2012-07-08 15:26:04 UTC (rev 9312)
+++ code/branches/presentation2012merge/src/modules/pickup/Pickup.h	2012-07-08 15:33:03 UTC (rev 9313)
@@ -108,42 +108,42 @@
             @brief Get the activation type of the Pickup.
             @return Returns the activation type of the Pickup.
             */
-            inline pickupActivationType::Value getActivationTypeDirect(void) const
+            inline pickupActivationType::Value getActivationType(void) const
                 { return this->activationType_; }
             /**
             @brief Get the duration type of the Pickup.
             @return Returns the duration type of the Pickup.
             */
-            inline pickupDurationType::Value getDurationTypeDirect(void) const
+            inline pickupDurationType::Value getDurationType(void) const
                 { return this->durationType_; }
 
-            const std::string& getActivationType(void) const; //!< Get the activation type of the Pickup.
-            const std::string& getDurationType(void) const; //!< Get the duration type of the Pickup.
+            const std::string& getActivationTypeAsString(void) const; //!< Get the activation type of the Pickup.
+            const std::string& getDurationTypeAsString(void) const; //!< Get the duration type of the Pickup.
 
             /**
             @brief Get whether the activation type is 'immediate'.
             @return Returns true if the activation type is 'immediate'.
             */
             inline bool isImmediate(void) const
-                { return this->getActivationTypeDirect() == pickupActivationType::immediate; }
+                { return this->getActivationType() == pickupActivationType::immediate; }
             /**
             @brief Get whether the activation type is 'onUse'.
             @return Returns true if the activation type is 'onUse'.
             */
             inline bool isOnUse(void) const
-                { return this->getActivationTypeDirect() == pickupActivationType::onUse; }
+                { return this->getActivationType() == pickupActivationType::onUse; }
             /**
             @brief Get whether the duration type is 'once'.
             @return Returns true if the duration type is 'once'.
             */
             inline bool isOnce(void) const
-                { return this->getDurationTypeDirect() == pickupDurationType::once; }
+                { return this->getDurationType() == pickupDurationType::once; }
             /**
             @brief Get whether the duration type is 'continuous'.
             @return Returns true if the duration type is 'continuous'.
             */
             inline bool isContinuous(void) const
-                { return this->getDurationTypeDirect() == pickupDurationType::continuous; }
+                { return this->getDurationType() == pickupDurationType::continuous; }
 
             virtual void changedPickedUp(void); //!< Should be called when the pickup has transited from picked up to dropped or the other way around.
             virtual void clone(OrxonoxClass*& item); //!< Creates a duplicate of the OrxonoxClass.
@@ -157,17 +157,17 @@
             @brief Set the activation type of the Pickup.
             @param type The activation type of the Pickup.
             */
-            inline void setActivationTypeDirect(pickupActivationType::Value type)
+            inline void setActivationType(pickupActivationType::Value type)
                 { this->activationType_ = type; }
             /**
             @brief Set the duration type of the Pickup.
             @param type The duration type of the Pickup.
             */
-            inline void setDurationTypeDirect(pickupDurationType::Value type)
+            inline void setDurationType(pickupDurationType::Value type)
                 { this->durationType_ = type; }
 
-            void setActivationType(const std::string& type); //!< Set the activation type of the Pickup.
-            void setDurationType(const std::string& type); //!< Set the duration type of the Pickup.
+            void setActivationTypeAsString(const std::string& type); //!< Set the activation type of the Pickup.
+            void setDurationTypeAsString(const std::string& type); //!< Set the duration type of the Pickup.
 
         private:
             void initialize(void); //!< Initializes the member variables.

Modified: code/branches/presentation2012merge/src/modules/pickup/items/DronePickup.cc
===================================================================
--- code/branches/presentation2012merge/src/modules/pickup/items/DronePickup.cc	2012-07-08 15:26:04 UTC (rev 9312)
+++ code/branches/presentation2012merge/src/modules/pickup/items/DronePickup.cc	2012-07-08 15:33:03 UTC (rev 9313)
@@ -74,7 +74,7 @@
     void DronePickup::initialize(void)
     {
         this->addTarget(ClassIdentifier<Pawn>::getIdentifier());
-        this->setDurationTypeDirect(pickupDurationType::once);
+        this->setDurationType(pickupDurationType::once);
         this->droneTemplate_ = "";
     }
 

Modified: code/branches/presentation2012merge/src/modules/pickup/items/MetaPickup.cc
===================================================================
--- code/branches/presentation2012merge/src/modules/pickup/items/MetaPickup.cc	2012-07-08 15:26:04 UTC (rev 9312)
+++ code/branches/presentation2012merge/src/modules/pickup/items/MetaPickup.cc	2012-07-08 15:33:03 UTC (rev 9313)
@@ -79,7 +79,7 @@
     {
         this->addTarget(ClassIdentifier<PickupCarrier>::getIdentifier());
 
-        this->setDurationTypeDirect(pickupDurationType::once);
+        this->setDurationType(pickupDurationType::once);
         this->metaType_ = pickupMetaType::none;
     }
 




More information about the Orxonox-commit mailing list