Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 8, 2012, 5:26:04 PM (13 years ago)
Author:
landauf
Message:

renamed some functions where enums are converted to/from strings for XMLPort to make it more obvious where the value is actually set and where it is only converted

File:
1 edited

Legend:

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

    r9305 r9312  
    101101        SUPER(MetaPickup, XMLPort, xmlelement, mode);
    102102
    103         XMLPortParam(MetaPickup, "metaType", setMetaType, getMetaType, xmlelement, mode);
     103        XMLPortParam(MetaPickup, "metaType", setMetaTypeAsString, getMetaTypeAsString, xmlelement, mode);
    104104
    105105        this->initializeIdentifier();
     
    119119        {
    120120            PickupCarrier* carrier = this->getCarrier();
    121             if(this->getMetaTypeDirect() != pickupMetaType::none && carrier != NULL)
     121            if(this->getMetaType() != pickupMetaType::none && carrier != NULL)
    122122            {
    123123                // If the metaType is destroyCarrier, then the PickupCarrier is destroyed.
    124                 if(this->getMetaTypeDirect() == pickupMetaType::destroyCarrier)
     124                if(this->getMetaType() == pickupMetaType::destroyCarrier)
    125125                {
    126126                    Pawn* pawn = orxonox_cast<Pawn*>(carrier);
     
    137137
    138138                    // If the metaType is use, then the Pickupable is set to used.
    139                     if(this->getMetaTypeDirect() == pickupMetaType::use && !pickup->isUsed())
     139                    if(this->getMetaType() == pickupMetaType::use && !pickup->isUsed())
    140140                    {
    141141                        pickup->setUsed(true);
    142142                    }
    143143                    // If the metaType is drop, then the Pickupable is dropped.
    144                     else if(this->getMetaTypeDirect() == pickupMetaType::drop)
     144                    else if(this->getMetaType() == pickupMetaType::drop)
    145145                    {
    146146                        pickup->drop();
    147147                    }
    148148                    // If the metaType is destroy, then the Pickupable is destroyed.
    149                     else if(this->getMetaTypeDirect() == pickupMetaType::destroy)
     149                    else if(this->getMetaType() == pickupMetaType::destroy)
    150150                    {
    151151                        pickup->Pickupable::destroy();
     
    171171
    172172        MetaPickup* pickup = orxonox_cast<MetaPickup*>(item);
    173         pickup->setMetaTypeDirect(this->getMetaTypeDirect());
     173        pickup->setMetaType(this->getMetaType());
    174174
    175175        pickup->initializeIdentifier();
     
    182182        Returns a string with the meta type of the MetaPickup.
    183183    */
    184     const std::string& MetaPickup::getMetaType(void) const
    185     {
    186         switch(this->getMetaTypeDirect())
     184    const std::string& MetaPickup::getMetaTypeAsString(void) const
     185    {
     186        switch(this->getMetaType())
    187187        {
    188188            case pickupMetaType::none:
     
    207207        A string with the type to be set.
    208208    */
    209     void MetaPickup::setMetaType(const std::string& type)
     209    void MetaPickup::setMetaTypeAsString(const std::string& type)
    210210    {
    211211        if(type == MetaPickup::metaTypeNone_s)
    212212        {
    213             this->setMetaTypeDirect(pickupMetaType::none);
     213            this->setMetaType(pickupMetaType::none);
    214214        }
    215215        else if(type == MetaPickup::metaTypeUse_s)
    216216        {
    217             this->setMetaTypeDirect(pickupMetaType::use);
     217            this->setMetaType(pickupMetaType::use);
    218218        }
    219219        else if(type == MetaPickup::metaTypeDrop_s)
    220220        {
    221             this->setMetaTypeDirect(pickupMetaType::drop);
     221            this->setMetaType(pickupMetaType::drop);
    222222        }
    223223        else if(type == MetaPickup::metaTypeDestroy_s)
    224224        {
    225             this->setMetaTypeDirect(pickupMetaType::destroy);
     225            this->setMetaType(pickupMetaType::destroy);
    226226        }
    227227        else if(type == MetaPickup::metaTypeDestroyCarrier_s)
    228228        {
    229             this->setMetaTypeDirect(pickupMetaType::destroyCarrier);
     229            this->setMetaType(pickupMetaType::destroyCarrier);
    230230        }
    231231        else
Note: See TracChangeset for help on using the changeset viewer.