Changeset 6731 for code/trunk/src/orxonox
- Timestamp:
- Apr 15, 2010, 2:47:39 PM (15 years ago)
- Location:
- code/trunk/src/orxonox/interfaces
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/orxonox/interfaces/Pickupable.cc
r6725 r6731 104 104 bool Pickupable::isTarget(const PickupCarrier* carrier) const 105 105 { 106 if(carrier == NULL) 107 return false; 106 108 return this->isTarget(carrier->getIdentifier()); 107 109 } … … 109 111 /** 110 112 @brief 111 Get whether a given class, represented by the input Identifier,is a target of this Pickupable.112 @param target113 The Identifier of which it has to be determinde whether it is a target of this Pickupable.114 @return 115 Returns true if the given Identifier is a target.116 */ 117 bool Pickupable::isTarget( Identifier* target) const113 Get whether the given Identififer is a target of this Pickupable. 114 @param identifier 115 The PickupCarrier of which it has to be determinde whether it is a target of this Pickupable. 116 @return 117 Returns true if the given PickupCarrier is a target. 118 */ 119 bool Pickupable::isTarget(const Identifier* identifier) const 118 120 { 119 121 //! Iterate through all targets of this Pickupable. 120 122 for(std::list<Identifier*>::const_iterator it = this->targets_.begin(); it != this->targets_.end(); it++) 121 123 { 122 if( target->isA(*it))124 if(identifier->isA(*it)) 123 125 return true; 124 126 } -
code/trunk/src/orxonox/interfaces/Pickupable.h
r6540 r6731 98 98 bool dropped(void); //!< Sets the Pickupable to not picked up or dropped. 99 99 100 bool isTarget(const PickupCarrier* carrier) const; //!< Get whether the given PickupCarrier is a target of this pickup.101 virtual bool isTarget(Identifier* identifier) const; //!< Get whether a given class, represented by the input Identifier, is a target of this Pickupable.100 virtual bool isTarget(const PickupCarrier* carrier) const; //!< Get whether the given PickupCarrier is a target of this pickup. 101 bool isTarget(const Identifier* identifier) const; //!< Get whether a given class, represented by the input Identifier, is a target of this Pickupable. 102 102 bool addTarget(PickupCarrier* target); //!< Add a PickupCarrier as target of this pickup. 103 103 bool addTarget(Identifier* identifier); //!< Add a class, representetd by the input Identifier, as target of this pickup.
Note: See TracChangeset
for help on using the changeset viewer.