Changeset 10765 for code/branches/cpp11_v2/src/orxonox/interfaces
- Timestamp:
- Nov 4, 2015, 10:25:42 PM (9 years ago)
- Location:
- code/branches/cpp11_v2/src/orxonox/interfaces
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/cpp11_v2/src/orxonox/interfaces/PickupCarrier.cc
r10624 r10765 127 127 { 128 128 if(!this->isTarget(pickup)) 129 return NULL;129 return nullptr; 130 130 131 131 if(pickup->isTarget(this)) // If the PickupCarrier itself is a target. 132 132 return this; 133 133 134 PickupCarrier* target = NULL;134 PickupCarrier* target = nullptr; 135 135 // Go recursively through all children to check whether they are the target. 136 136 std::vector<PickupCarrier*>* children = this->getCarrierChildren(); -
code/branches/cpp11_v2/src/orxonox/interfaces/PickupCarrier.h
r9667 r10765 59 59 But this structure has to be established first. 60 60 - <b>getCarrierChildren()</b> To this end a PickupCarrier needs to implement getCarrierChildren() which returns a list of its direct PickupCarrier children. If you need an example, have a look at @ref orxonox::Pawn "Pawn" and @ref orxonox::Engine "Engine". 61 - <b>getCarrierParent()</b> This is the method in the other direction. It returns the parent of this PickupCarrier, or NULLif the PickupCarrier is a root node in this hierarchy.61 - <b>getCarrierParent()</b> This is the method in the other direction. It returns the parent of this PickupCarrier, or nullptr if the PickupCarrier is a root node in this hierarchy. 62 62 63 63 @author -
code/branches/cpp11_v2/src/orxonox/interfaces/Pickupable.cc
r10624 r10765 56 56 RegisterObject(Pickupable); 57 57 58 this->carrier_ = NULL;58 this->carrier_ = nullptr; 59 59 60 60 this->beingDestroyed_ = false; … … 143 143 bool Pickupable::isTarget(const PickupCarrier* carrier) const 144 144 { 145 if(carrier == NULL)145 if(carrier == nullptr) 146 146 return false; 147 147 … … 210 210 bool Pickupable::pickup(PickupCarrier* carrier) 211 211 { 212 if(carrier == NULL || this->isPickedUp()) // If carrier is NULLor the Pickupable is already picked up.212 if(carrier == nullptr || this->isPickedUp()) // If carrier is nullptr or the Pickupable is already picked up. 213 213 return false; 214 214 … … 237 237 return false; 238 238 239 assert(this->getCarrier()); // The Carrier cannot be NULLat this point.239 assert(this->getCarrier()); // The Carrier cannot be nullptr at this point. 240 240 if(!this->getCarrier()->removePickup(this)) //TODO Shouldn't this be a little later? 241 241 orxout(internal_warning, context::pickups) << "Pickupable (&" << this << ", " << this->getIdentifier()->getName() << ") is being dropped, but it was not present in the PickupCarriers list of pickups." << endl; … … 249 249 created = this->createSpawner(); 250 250 251 this->setCarrier( NULL);251 this->setCarrier(nullptr); 252 252 253 253 if(!created && createSpawner) // If a PickupSpawner should have been created but wasn't. … … 301 301 orxout(verbose, context::pickups) << "Pickupable (&" << this << ") changed Carrier (& " << carrier << ")." << endl; 302 302 303 if(carrier != NULL&& tell)303 if(carrier != nullptr && tell) 304 304 { 305 305 if(!carrier->addPickup(this))
Note: See TracChangeset
for help on using the changeset viewer.