- Timestamp:
- Dec 17, 2008, 8:00:43 AM (15 years ago)
- Location:
- code/branches/presentation
- Files:
-
- 1 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation
- Property svn:mergeinfo changed
/code/branches/pickups2 (added) merged: 2110,2136,2202,2227,2289-2290,2293-2294,2324,2342,2389,2397
- Property svn:mergeinfo changed
-
code/branches/presentation/src/orxonox/objects/pickup/ShipEquipment.cc
- Property svn:eol-style set to native
r2498 r2500 1 #include " Item.h"1 #include "BaseItem.h" 2 2 #include "ShipEquipment.h" 3 3 #include "objects/worldentities/pawns/Pawn.h" … … 9 9 @brief 10 10 Insert a permanent Item to the Equipment. Is usually called by the addTo function in Items. 11 11 12 12 @param item 13 13 pointer to the item which is to be inserted. … … 16 16 if new item has sucessfully been added it will return true, in any other case the return value is false. 17 17 */ 18 bool ShipEquipment::insert( Item* item)18 bool ShipEquipment::insert(BaseItem* item) 19 19 { 20 20 if(checkSlot(item)==NULL) 21 21 { 22 Equipment.insert ( std::pair<std::string, Item*>(item->getName(),item) );22 Equipment.insert ( std::pair<std::string, BaseItem*>(item->getName(),item) ); 23 23 return true; 24 24 } … … 26 26 { 27 27 COUT(3) << "SWAP?" << endl; 28 //Abfrage- irgendne ifschleife... 28 //Abfrage- irgendne ifschleife... 29 29 if((checkSlot(item)->dropped(player))==true); 30 30 { 31 Equipment.insert ( std::pair<std::string, Item*>(item->getName(),item) );31 Equipment.insert ( std::pair<std::string, BaseItem*>(item->getName(),item) ); 32 32 COUT(3) << "SWAPPED!" << endl; 33 33 return true; … … 42 42 @brief 43 43 Erases a permanent Item in the Equipment. Is usually called by the remove/dropped function in Items. 44 44 45 45 @param item 46 46 pointer to the item which is to be erased. … … 49 49 if new item has sucessfully been erased it will return true, in any other case the return value is false. 50 50 */ 51 bool ShipEquipment::erase ( Item* item)51 bool ShipEquipment::erase (BaseItem* item) 52 52 { 53 std::multimap<std::string, Item*>::iterator it = Equipment.find(item->getName());53 std::multimap<std::string,BaseItem*>::iterator it = Equipment.find(item->getName()); 54 54 if(it != Equipment.end()) 55 55 { … … 59 59 return false; 60 60 }; 61 /*void print(std::multimap<std::string, Item*> eut)61 /*void print(std::multimap<std::string, BaseItem*> eut) 62 62 { 63 std::multimap<std::string, Item*>::iterator it;63 std::multimap<std::string,BaseItem*>::iterator it; 64 64 COUT(3) << "Liste:" << endl; 65 65 for ( it=eut.begin() ; it != eut.end(); ++it ) … … 75 75 { 76 76 //print(Equipment); 77 for (std::multimap<std::string, Item*>::iterator it = Equipment.begin(); it != Equipment.end(); )77 for (std::multimap<std::string,BaseItem*>::iterator it = Equipment.begin(); it != Equipment.end(); ) 78 78 { 79 79 … … 83 83 } 84 84 85 Item* ShipEquipment::checkSlot(Item* item)85 BaseItem* ShipEquipment::checkSlot(BaseItem* item) 86 86 { 87 std::multimap<std::string, Item*>::iterator it;87 std::multimap<std::string,BaseItem*>::iterator it; 88 88 for ( it= getPlayer()->getPickUp().getEquipment().begin() ; it != getPlayer()->getPickUp().getEquipment().end(); it++ ) 89 89 { … … 94 94 return NULL; 95 95 }; 96 96 97 97 }
Note: See TracChangeset
for help on using the changeset viewer.