- Timestamp:
- May 27, 2010, 10:44:10 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation3/src/modules/pickup/PickupManager.cc
r6965 r6996 39 39 #include "core/ScopedSingletonManager.h" 40 40 #include "core/Identifier.h" 41 #include "util/Convert.h" 41 42 #include "interfaces/PickupCarrier.h" 42 43 #include "infos/PlayerInfo.h" … … 64 65 65 66 this->defaultRepresentation_ = new PickupRepresentation(); 66 this->pickupsIndex_ = 0;67 67 68 68 COUT(3) << "PickupManager created." << std::endl; … … 154 154 { 155 155 this->pickupsList_.clear(); 156 this->pickupsIndex_ = 0;157 156 158 157 PlayerInfo* player = GUIManager::getInstance().getPlayer(PickupManager::guiName_s); … … 169 168 for(std::set<Pickupable*>::iterator pickup = pickups.begin(); pickup != pickups.end(); pickup++) 170 169 { 171 this->pickupsList_.insert( *pickup);170 this->pickupsList_.insert(std::pair<Pickupable*, WeakPtr<Pickupable> >(*pickup, WeakPtr<Pickupable>(*pickup))); 172 171 } 173 172 } … … 199 198 void PickupManager::dropPickup(orxonox::Pickupable* pickup) 200 199 { 200 std::map<Pickupable*, WeakPtr<Pickupable> >::iterator it = this->pickupsList_.find(pickup); 201 if(pickup == NULL || it == this->pickupsList_.end() || it->second.get() == NULL) 202 return; 203 201 204 if(!pickup->isPickedUp()) 202 205 return; 203 206 204 207 PickupCarrier* carrier = pickup->getCarrier(); 205 208 if(pickup != NULL && carrier != NULL) 209 { 206 210 carrier->drop(pickup); 211 } 207 212 } 208 213 209 214 void PickupManager::usePickup(orxonox::Pickupable* pickup, bool use) 210 215 { 216 std::map<Pickupable*, WeakPtr<Pickupable> >::iterator it = this->pickupsList_.find(pickup); 217 if(pickup == NULL || it == this->pickupsList_.end() || it->second.get() == NULL) 218 return; 219 211 220 if(!pickup->isPickedUp()) 212 221 return;
Note: See TracChangeset
for help on using the changeset viewer.