Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 7, 2010, 2:05:05 PM (14 years ago)
Author:
dafrick
Message:

Simplification in creation of PickupIdentifier.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/pickup3/src/orxonox/pickup/PickupIdentifier.cc

    r6478 r6480  
    3030
    3131#include "core/CoreIncludes.h"
     32#include "interfaces/Pickupable.h"
    3233
    3334namespace orxonox
     
    3839        Constructor. Registers the object and initializes member variables.
    3940    */
    40     PickupIdentifier::PickupIdentifier()
     41    PickupIdentifier::PickupIdentifier(Pickupable* pickup)
    4142    {
    4243        RegisterRootObject(PickupIdentifier);
    4344       
    44         this->classIdentifier_ = NULL;
     45        this->pickup_ = pickup;
    4546    }
    4647   
     
    6162    {
    6263        //! If the classIdentifiers are not the same (meaning the PickupIdentifiers identify different classes), the obviously the two Pickupables identified by the PickupIdentifiers cannot be the same. An ordering is established through the alphabetical ordering of the respective classnames.
    63         if(!identifier->classIdentifier_->isExactlyA(this->classIdentifier_))
    64             return this->classIdentifier_->getName().compare(identifier->classIdentifier_->getName());
     64        if(!identifier->pickup_->getIdentifier()->isExactlyA(this->pickup_->getIdentifier()))
     65            return this->pickup_->getIdentifier()->getName().compare(identifier->pickup_->getIdentifier()->getName());
    6566       
    6667        //! If the class is the same for both PickupIdentifiers we go on to check the parameters of the class.
     
    8687           
    8788        return false;
    88     }
    89    
    90     /**
    91     @brief
    92         Add the class of the Pickupable to its PickupIdentifier.
    93     @param identifier
    94         A pointer to the Identifier of the class.
    95     */
    96     void PickupIdentifier::addClass(Identifier* identifier)
    97     {
    98         this->classIdentifier_ = identifier;
    9989    }
    10090   
Note: See TracChangeset for help on using the changeset viewer.