Changeset 2290 for code/branches/pickups2/src/orxonox/objects
- Timestamp:
- Nov 27, 2008, 3:40:01 PM (16 years ago)
- Location:
- code/branches/pickups2/src/orxonox/objects/pickup
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/pickups2/src/orxonox/objects/pickup/ShipEquipment.cc
r2289 r2290 4 4 namespace orxonox 5 5 { 6 ShipEquipmentClass::int getSpace()6 bool insert(Item* item) 7 7 { 8 return Usable.size()+Trunk.size(); 8 if(checkSlot(player)==true) 9 Equipment.insert ( std::pair<std::string, Item*>(item->getName(),item) ); 10 else 11 COUT(3) << "swap?" << std::endl; 12 13 14 15 16 17 }; 18 bool erase (Item* item) 19 { 20 if(Equipment.find(item->getName())!= Equipment.end()) 21 { 22 std::multimap<std::string,Item*>::iterator it; 23 it=Equipment.find(item->getName()); 24 Equipment.erase (it); 25 return true; 26 } 27 else 28 return false; 29 }; 30 bool checkSlot(Item* item) const 31 { 32 std::multimap<std::string,Item*>::iterator it; 33 for ( it=Equipment.begin() ; it != Equipment.end(); it++ ) 34 { 35 if((*it).second->playerBaseClass_==item->playerBaseClass_) 36 return false; 9 37 } 38 return true; 39 }; 10 40 } -
code/branches/pickups2/src/orxonox/objects/pickup/ShipEquipment.h
r2289 r2290 27 27 return Usable.size()+Trunk.size(); 28 28 }; 29 29 bool insert(Item* item); 30 bool erase (Item* item); 31 bool checkSlot(Item* item) const; 30 32 // const std::multimap<std::string, Item*>& getEquipment() const { return this->Equipment; } 31 33
Note: See TracChangeset
for help on using the changeset viewer.