Changeset 11314 for code/branches/HUD_HS16/src/modules/pickup
- Timestamp:
- Nov 28, 2016, 7:21:35 PM (8 years ago)
- Location:
- code/branches/HUD_HS16/src/modules/pickup
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/HUD_HS16/src/modules/pickup/CMakeLists.txt
r9348 r11314 19 19 PickupPrecompiledHeaders.h 20 20 LINK_LIBRARIES 21 overlays 21 22 orxonox 22 23 SOURCE_FILES ${PICKUP_SRC_FILES} -
code/branches/HUD_HS16/src/modules/pickup/PickupManager.cc
r11305 r11314 83 83 } 84 84 85 void PickupManager::setPickupSystem(HUDPickupSystem* system)86 {87 pickupSystem=system;88 }89 90 85 /** 91 86 @brief … … 271 266 assert(pickup); 272 267 268 if(!pickupSystem) 269 { 270 for (HUDPickupSystem* hud : ObjectList<HUDPickupSystem>()) 271 pickupSystem = hud; 272 } 273 assert(pickupSystem); //pickupSystem HAS to be there! 274 273 275 if(!GameMode::isMaster()) // If this is neither standalone nor the server. 274 276 return; … … 299 301 this->pickups_[index] = pickup; 300 302 301 //TODO 302 std::vector<Pickupable*> picks; 303 304 PickupManager& manager = PickupManager::getInstance(); 305 306 Pickupable* pickup = nullptr; 307 308 for(uint32_t i = 0; i!=10; i++) 309 { 310 pickup=manager.pickups_.find(i)->second; 311 picks.push_back(pickup); 312 } 313 // pickupSystem->updatePickupList(picks); 303 orxout() << "the pickup is: " << pickup << endl; 304 305 this->picks.push_back(pickup); 306 307 pickupSystem->updatePickupList(picks); 314 308 315 309 } … … 320 314 index = it->second; 321 315 322 323 316 this->indexes_.erase(pickup); 324 317 this->pickups_.find(index)->second=nullptr; //set to null, so that can be identified as free slot by getPickupIndex() 318 319 320 this->picks.erase(std::remove(this->picks.begin(), this->picks.end(), pickup), this->picks.end()); //remove pickup from vector 321 322 pickupSystem->removePickup(pickup); 323 pickupSystem->updatePickupList(picks); 325 324 } 326 325 -
code/branches/HUD_HS16/src/modules/pickup/PickupManager.h
r11305 r11314 42 42 43 43 #include "PickupRepresentation.h" 44 44 #include "interfaces/Pickupable.h" 45 45 #include "util/Singleton.h" 46 46 #include "interfaces/PickupListener.h" … … 153 153 private: 154 154 HUDPickupSystem* pickupSystem; 155 std::vector<Pickupable*> picks; 156 155 157 static PickupManager* singletonPtr_s; 156 158 static const std::string guiName_s; //!< The name of the PickupInventory
Note: See TracChangeset
for help on using the changeset viewer.