- Timestamp:
- Nov 28, 2008, 2:00:22 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/pickups2/src/orxonox/objects/pickup/Item.cc
r2289 r2293 1 1 /* has to be added to player 2 2 multimap<std::string, Item*> Equipment;*/ 3 3 4 4 5 #include "Item.h" … … 27 28 } 28 29 29 voidItem::addTo (Pawn* player)30 bool Item::addTo (Pawn* player) 30 31 { 31 if(checkSlot(player)==true)32 /*if(checkSlot(player)==true) 32 33 player->pickUp.Equipment.insert ( std::pair<std::string, Item*>(this->getName(),this) ); 33 34 else 34 COUT(3) << "swap?" << std::endl; 35 COUT(3) << "swap?" << std::endl;*/ 36 return player->getPickUp().insert(this); 35 37 } 36 38 bool Item::remove(Pawn* player) 37 39 { 38 if(player->pickUp.Equipment.find(this->getName())!= player->pickUp.Equipment.end())40 /*if(player->pickUp.Equipment.find(this->getName())!= player->pickUp.Equipment.end()) 39 41 { 40 42 std::multimap<std::string,Item*>::iterator it; … … 44 46 } 45 47 else 46 return false; 48 return false;*/ 49 return player->getPickUp().erase(this); 47 50 } 48 51 bool Item::checkSlot(Pawn* player) 49 52 { 50 std::multimap<std::string,Item*>::iterator it;53 /*std::multimap<std::string,Item*>::iterator it; 51 54 for ( it=player->pickUp.Equipment.begin() ; it != player->pickUp.Equipment.end(); it++ ) 52 55 { … … 54 57 return false; 55 58 } 56 return true; 59 return true;*/ 60 return player->getPickUp().checkSlot(this); 57 61 } 58 62 void Item::setPlayerBaseClassName(const std::string& name)
Note: See TracChangeset
for help on using the changeset viewer.