- Timestamp:
- Jun 9, 2010, 9:32:58 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation3/src/orxonox/pickup/PickupIdentifier.cc
r6725 r7127 39 39 namespace orxonox 40 40 { 41 41 42 42 /** 43 43 @brief … … 47 47 { 48 48 RegisterRootObject(PickupIdentifier); 49 49 50 50 if(pickup == NULL) 51 51 COUT(1) << "Error, PickupIdentifier was created without a valid Pickupable." << std::endl; 52 52 53 53 this->pickup_ = pickup; 54 54 } 55 55 56 56 PickupIdentifier::~PickupIdentifier() 57 57 { 58 58 59 59 } 60 60 61 61 /** 62 62 @brief … … 74 74 COUT(1) << "Error in PickupIdentifier::compare: Input Identifier is NULL." << std::endl; 75 75 } 76 76 77 77 if(identifier->pickup_ == NULL && this->pickup_ == NULL) 78 78 { … … 80 80 COUT(1) << "Error in PickupIdentifier::compare: Pickup stored by Identifier is NULL." << std::endl; 81 81 } 82 82 83 83 if(identifier->pickup_ == NULL) 84 84 { … … 86 86 COUT(1) << "Error in PickupIdentifier::compare: Pickup stored by Identifier is NULL." << std::endl; 87 87 } 88 88 89 89 if(this->pickup_ == NULL) 90 90 { … … 92 92 COUT(1) << "Error in PickupIdentifier::compare: Pickup stored by Identifier is NULL." << std::endl; 93 93 } 94 94 95 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. 96 96 if(!identifier->pickup_->getIdentifier()->isExactlyA(this->pickup_->getIdentifier())) 97 97 return this->pickup_->getIdentifier()->getName().compare(identifier->pickup_->getIdentifier()->getName()); 98 98 99 99 //! If the class is the same for both PickupIdentifiers we go on to check the parameters of the class. 100 100 //! If the two have a different number of parameters then obviusly something is very wrong. … … 104 104 return this->parameters_.size()-identifier->parameters_.size(); 105 105 } 106 106 107 107 //! We iterate through all parameters and compar their values (which are strings). The first parameter is the most significant. The ordering is once again established by the alphabetical comparison of the two value strings. 108 108 for(std::map<std::string, std::string>::const_iterator it = this->parameters_.begin(); it != this->parameters_.end(); it++) … … 117 117 return it->second.compare(identifier->parameters_.find(it->first)->second); 118 118 } 119 119 120 120 return 0; 121 121 } 122 122 123 123 /** 124 124 @brief … … 134 134 { 135 135 COUT(4) << "PickupIdentifier " << name << ", " << value << std::endl; 136 136 137 137 if(!(this->parameters_.find(name) == this->parameters_.end())) 138 138 { … … 140 140 return false; 141 141 } 142 142 143 143 this->parameters_[name] = value; 144 144 145 145 return true; 146 146 } 147 147 148 148 }
Note: See TracChangeset
for help on using the changeset viewer.