Changeset 2342 for code/branches/pickups2/src/orxonox
- Timestamp:
- Dec 4, 2008, 1:20:58 PM (16 years ago)
- Location:
- code/branches/pickups2/src/orxonox/objects/pickup
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/pickups2/src/orxonox/objects/pickup/Item.cc
r2324 r2342 31 31 bool Item::addTo (Pawn* player) 32 32 { 33 33 34 34 return player->getPickUp().insert(this); 35 35 /*if(checkSlot(player)==true) … … 53 53 bool Item::checkSlot(Pawn* player) 54 54 { 55 std::multimap<std::string,Item*>::iterator it;55 /*std::multimap<std::string,Item*>::iterator it; 56 56 for ( it=player->getPickUp().getEquipment().begin() ; it != player->getPickUp().getEquipment().end(); it++ ) 57 57 { 58 58 if((*it).second->playerBaseClass_==this->playerBaseClass_) 59 //das isch schmarre...machs mit isExactlyA(...) 59 60 return false; 60 61 } 61 return true; 62 //return player->getPickUp().checkSlot(player);62 return true;*/ 63 return player->getPickUp().checkSlot(this); 63 64 } 64 65 void Item::setPlayerBaseClassName(const std::string& name) -
code/branches/pickups2/src/orxonox/objects/pickup/PickupSpawner.h
r2294 r2342 18 18 virtual void tick(float dt); 19 19 20 20 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); 21 21 virtual void triggering(Pawn* trigger); // Wenn ein Spieler in die Naehe kommt 22 22 … … 29 29 inline float getDistance() const 30 30 { return this->distance_; } 31 31 32 32 private: 33 33 std::string itemtemplate_; … … 38 38 39 39 #endif /* _PickupSpawner_H__ */ 40 41 40 42 41 … … 55 54 56 55 56 -
code/branches/pickups2/src/orxonox/objects/pickup/ShipEquipment.cc
r2324 r2342 16 16 COUT(3) << "swap?" << std::endl; 17 17 return false; 18 18 19 19 return false; 20 20 }; … … 24 24 if(it != Equipment.end()) 25 25 { 26 //it->second->dropped(this->getPlayer());27 26 Equipment.erase (it); 28 27 return true; 29 28 } 30 else 31 return false; 29 return false; 32 30 }; 31 /*void print(std::multimap<std::string, Item*> eut) 32 { 33 std::multimap<std::string,Item*>::iterator it; 34 COUT(3) << "Liste:" << endl; 35 for ( it=eut.begin() ; it != eut.end(); ++it ) 36 COUT(3) << (*it).first << endl; 33 37 38 }*/ 34 39 void ShipEquipment::eraseAll() 35 40 { 36 41 //print(Equipment); 37 42 for (std::multimap<std::string,Item*>::iterator it = Equipment.begin(); it != Equipment.end(); ) 38 43 { 39 44 40 45 (it++)->second->dropped(this->getPlayer()); 41 46 } 47 //print(Equipment); 42 48 } 43 49 … … 47 53 for ( it= getPlayer()->getPickUp().getEquipment().begin() ; it != getPlayer()->getPickUp().getEquipment().end(); it++ ) 48 54 { 49 if((*it).second->getPlayerBaseClass()==item->getPlayerBaseClass()) 55 //if((*it).second->getPlayerBaseClass()==item->getPlayerBaseClass()) 56 if(item->isExactlyA((*it).second->getIdentifier())) 50 57 return false; 51 58 } -
code/branches/pickups2/src/orxonox/objects/pickup/ShipEquipment.h
r2324 r2342 28 28 bool insert(Item* item); 29 29 bool erase (Item* item); 30 //void print(std::multimap<std::string, Item*> eut); 30 31 void eraseAll(); 31 32 bool checkSlot(Item* item); … … 37 38 inline void setPlayer(Pawn* setplayer) 38 39 {this->player = setplayer;} 39 40 40 private: 41 41 Pawn* player;
Note: See TracChangeset
for help on using the changeset viewer.