Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Sep 28, 2010, 5:31:59 PM (14 years ago)
Author:
dafrick
Message:

Some documenting and cleaning up/re-organization in pickups module.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/modules/pickup/PickupManager.cc

    r7284 r7494  
    2121 *
    2222 *   Author:
    23  *      ...
     23 *      Damian 'Mozork' Frick
    2424 *   Co-authors:
    2525 *      ...
     
    100100    bool PickupManager::registerRepresentation(const PickupIdentifier* identifier, PickupRepresentation* representation)
    101101    {
    102         if(identifier == NULL || representation == NULL || this->representations_.find(identifier) != this->representations_.end()) //!< If the Pickupable already has a Representation registered.
     102        assert(identifier);
     103        assert(representation);
     104
     105        if(this->representations_.find(identifier) != this->representations_.end()) // If the Pickupable already has a Representation registered.
    103106            return false;
    104107
    105108        this->representations_[identifier] = representation;
    106109
    107         COUT(4) << "PickupRepresentation " << representation << " registered with the PickupManager." << std::endl;
     110        COUT(4) << "PickupRepresentation &" << representation << " registered with the PickupManager." << std::endl;
    108111        return true;
    109112    }
     
    121124    bool PickupManager::unregisterRepresentation(const PickupIdentifier* identifier, PickupRepresentation* representation)
    122125    {
    123         if(identifier == NULL || representation == NULL)
    124             return false;
     126        assert(identifier);
     127        assert(representation);
    125128
    126129        std::map<const PickupIdentifier*, PickupRepresentation*, PickupIdentifierCompare>::iterator it = this->representations_.find(identifier);
     
    130133        this->representations_.erase(it);
    131134
    132         COUT(4) << "PickupRepresentation " << representation << " unregistered with the PickupManager." << std::endl;
     135        COUT(4) << "PickupRepresentation &" << representation << " unregistered with the PickupManager." << std::endl;
    133136        return true;
    134137    }
     
    167170        if(pickup != NULL)
    168171            return this->getRepresentation(pickup->getPickupIdentifier());
    169        
     172
    170173        return NULL;
    171174    }
     
    268271        if(pickup == NULL)
    269272            return;
    270        
     273
    271274        std::map<Pickupable*, WeakPtr<Pickupable> >::iterator it = this->pickupsList_.find(pickup); // Get the WeakPointer of the Pickupable.
    272275        // If either the input Pickupable is not in the PickupManagers list or it no longer exists, the method returns.
Note: See TracChangeset for help on using the changeset viewer.