Changeset 6725 for code/trunk/src/orxonox
- Timestamp:
- Apr 13, 2010, 10:39:54 PM (15 years ago)
- Location:
- code/trunk/src/orxonox
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/orxonox/interfaces/Pickupable.cc
r6540 r6725 46 46 Constructor. Registers the objects and initializes its member variables. 47 47 */ 48 Pickupable::Pickupable() : used_(false), pickedUp_(false)48 Pickupable::Pickupable() : pickupIdentifier_(NULL), used_(false), pickedUp_(false) 49 49 { 50 50 RegisterRootObject(Pickupable); … … 69 69 this->setCarrier(NULL); 70 70 } 71 72 if(this->pickupIdentifier_ != NULL) 73 this->pickupIdentifier_->destroy(); 71 74 } 72 75 -
code/trunk/src/orxonox/pickup/PickupIdentifier.cc
r6540 r6725 48 48 RegisterRootObject(PickupIdentifier); 49 49 50 if(pickup == NULL) 51 COUT(1) << "Error, PickupIdentifier was created without a valid Pickupable." << std::endl; 52 50 53 this->pickup_ = pickup; 51 54 } … … 53 56 PickupIdentifier::~PickupIdentifier() 54 57 { 55 58 56 59 } 57 60 … … 66 69 int PickupIdentifier::compare(const PickupIdentifier* identifier) const 67 70 { 71 if(identifier == NULL) 72 { 73 return 1; 74 COUT(1) << "Error in PickupIdentifier::compare: Input Identifier is NULL." << std::endl; 75 } 76 77 if(identifier->pickup_ == NULL && this->pickup_ == NULL) 78 { 79 return 0; 80 COUT(1) << "Error in PickupIdentifier::compare: Pickup stored by Identifier is NULL." << std::endl; 81 } 82 83 if(identifier->pickup_ == NULL) 84 { 85 return 1; 86 COUT(1) << "Error in PickupIdentifier::compare: Pickup stored by Identifier is NULL." << std::endl; 87 } 88 89 if(this->pickup_ == NULL) 90 { 91 return -1; 92 COUT(1) << "Error in PickupIdentifier::compare: Pickup stored by Identifier is NULL." << std::endl; 93 } 94 68 95 //! 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. 69 96 if(!identifier->pickup_->getIdentifier()->isExactlyA(this->pickup_->getIdentifier())) … … 91 118 } 92 119 93 return false;120 return 0; 94 121 } 95 122
Note: See TracChangeset
for help on using the changeset viewer.