Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9313


Ignore:
Timestamp:
Jul 8, 2012, 5:33:03 PM (12 years ago)
Author:
landauf
Message:

found some more functions to rename

Location:
code/branches/presentation2012merge/src/modules/pickup
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation2012merge/src/modules/pickup/Pickup.cc

    r9305 r9313  
    102102        SUPER(Pickup, XMLPort, xmlelement, mode);
    103103
    104         XMLPortParam(Pickup, "activationType", setActivationType, getActivationType, xmlelement, mode);
    105         XMLPortParam(Pickup, "durationType", setDurationType, getDurationType, xmlelement, mode);
     104        XMLPortParam(Pickup, "activationType", setActivationTypeAsString, getActivationTypeAsString, xmlelement, mode);
     105        XMLPortParam(Pickup, "durationType", setDurationTypeAsString, getDurationTypeAsString, xmlelement, mode);
    106106
    107107        this->initializeIdentifier();
     
    114114        Returns a string containing the activation type.
    115115    */
    116     const std::string& Pickup::getActivationType(void) const
    117     {
    118         switch(this->activationType_)
     116    const std::string& Pickup::getActivationTypeAsString(void) const
     117    {
     118        switch(this->getActivationType())
    119119        {
    120120            case pickupActivationType::immediate:
     
    133133        Returns a string containing the duration type.
    134134    */
    135     const std::string& Pickup::getDurationType(void) const
    136     {
    137         switch(this->durationType_)
     135    const std::string& Pickup::getDurationTypeAsString(void) const
     136    {
     137        switch(this->getDurationType())
    138138        {
    139139            case pickupDurationType::once:
     
    152152        The activation type of the Pickup as a string.
    153153    */
    154     void Pickup::setActivationType(const std::string& type)
     154    void Pickup::setActivationTypeAsString(const std::string& type)
    155155    {
    156156        if(type == Pickup::activationTypeImmediate_s)
    157             this->activationType_ = pickupActivationType::immediate;
     157            this->setActivationType(pickupActivationType::immediate);
    158158        else if(type == Pickup::activationTypeOnUse_s)
    159             this->activationType_ = pickupActivationType::onUse;
     159            this->setActivationType(pickupActivationType::onUse);
    160160        else
    161161            orxout(internal_error, context::pickups) << "Invalid activationType '" << type << "' in " << this->getIdentifier()->getName() << "." << endl;
     
    168168        The duration type of the Pickup as a string.
    169169    */
    170     void Pickup::setDurationType(const std::string& type)
     170    void Pickup::setDurationTypeAsString(const std::string& type)
    171171    {
    172172        if(type == Pickup::durationTypeOnce_s)
    173             this->durationType_ = pickupDurationType::once;
     173            this->setDurationType(pickupDurationType::once);
    174174        else if(type == Pickup::durationTypeContinuous_s)
    175             this->durationType_ = pickupDurationType::continuous;
     175            this->setDurationType(pickupDurationType::continuous);
    176176        else
    177177            orxout(internal_error, context::pickups) << "Invalid durationType '" << type << "' in " << this->getIdentifier()->getName() << "." << endl;
     
    206206
    207207        Pickup* pickup = orxonox_cast<Pickup*>(item);
    208         pickup->setActivationTypeDirect(this->getActivationTypeDirect());
    209         pickup->setDurationTypeDirect(this->getDurationTypeDirect());
     208        pickup->setActivationType(this->getActivationType());
     209        pickup->setDurationType(this->getDurationType());
    210210
    211211        pickup->initializeIdentifier();
  • code/branches/presentation2012merge/src/modules/pickup/Pickup.h

    r8108 r9313  
    109109            @return Returns the activation type of the Pickup.
    110110            */
    111             inline pickupActivationType::Value getActivationTypeDirect(void) const
     111            inline pickupActivationType::Value getActivationType(void) const
    112112                { return this->activationType_; }
    113113            /**
     
    115115            @return Returns the duration type of the Pickup.
    116116            */
    117             inline pickupDurationType::Value getDurationTypeDirect(void) const
     117            inline pickupDurationType::Value getDurationType(void) const
    118118                { return this->durationType_; }
    119119
    120             const std::string& getActivationType(void) const; //!< Get the activation type of the Pickup.
    121             const std::string& getDurationType(void) const; //!< Get the duration type of the Pickup.
     120            const std::string& getActivationTypeAsString(void) const; //!< Get the activation type of the Pickup.
     121            const std::string& getDurationTypeAsString(void) const; //!< Get the duration type of the Pickup.
    122122
    123123            /**
     
    126126            */
    127127            inline bool isImmediate(void) const
    128                 { return this->getActivationTypeDirect() == pickupActivationType::immediate; }
     128                { return this->getActivationType() == pickupActivationType::immediate; }
    129129            /**
    130130            @brief Get whether the activation type is 'onUse'.
     
    132132            */
    133133            inline bool isOnUse(void) const
    134                 { return this->getActivationTypeDirect() == pickupActivationType::onUse; }
     134                { return this->getActivationType() == pickupActivationType::onUse; }
    135135            /**
    136136            @brief Get whether the duration type is 'once'.
     
    138138            */
    139139            inline bool isOnce(void) const
    140                 { return this->getDurationTypeDirect() == pickupDurationType::once; }
     140                { return this->getDurationType() == pickupDurationType::once; }
    141141            /**
    142142            @brief Get whether the duration type is 'continuous'.
     
    144144            */
    145145            inline bool isContinuous(void) const
    146                 { return this->getDurationTypeDirect() == pickupDurationType::continuous; }
     146                { return this->getDurationType() == pickupDurationType::continuous; }
    147147
    148148            virtual void changedPickedUp(void); //!< Should be called when the pickup has transited from picked up to dropped or the other way around.
     
    158158            @param type The activation type of the Pickup.
    159159            */
    160             inline void setActivationTypeDirect(pickupActivationType::Value type)
     160            inline void setActivationType(pickupActivationType::Value type)
    161161                { this->activationType_ = type; }
    162162            /**
     
    164164            @param type The duration type of the Pickup.
    165165            */
    166             inline void setDurationTypeDirect(pickupDurationType::Value type)
     166            inline void setDurationType(pickupDurationType::Value type)
    167167                { this->durationType_ = type; }
    168168
    169             void setActivationType(const std::string& type); //!< Set the activation type of the Pickup.
    170             void setDurationType(const std::string& type); //!< Set the duration type of the Pickup.
     169            void setActivationTypeAsString(const std::string& type); //!< Set the activation type of the Pickup.
     170            void setDurationTypeAsString(const std::string& type); //!< Set the duration type of the Pickup.
    171171
    172172        private:
  • code/branches/presentation2012merge/src/modules/pickup/items/DronePickup.cc

    r9312 r9313  
    7575    {
    7676        this->addTarget(ClassIdentifier<Pawn>::getIdentifier());
    77         this->setDurationTypeDirect(pickupDurationType::once);
     77        this->setDurationType(pickupDurationType::once);
    7878        this->droneTemplate_ = "";
    7979    }
  • code/branches/presentation2012merge/src/modules/pickup/items/MetaPickup.cc

    r9312 r9313  
    8080        this->addTarget(ClassIdentifier<PickupCarrier>::getIdentifier());
    8181
    82         this->setDurationTypeDirect(pickupDurationType::once);
     82        this->setDurationType(pickupDurationType::once);
    8383        this->metaType_ = pickupMetaType::none;
    8484    }
Note: See TracChangeset for help on using the changeset viewer.