Changeset 6417 for code/trunk/src/orxonox/pickup
- Timestamp:
- Dec 25, 2009, 10:23:58 PM (15 years ago)
- Location:
- code/trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
-
code/trunk/src/orxonox/pickup/DroppedItem.cc
r5929 r6417 83 83 if (this->item_) 84 84 { 85 COUT(3) << "Delete DroppedItem with '" << this->item_->getPickupIdentifier() << "'"<< std::endl;85 COUT(3) << "Delete DroppedItem with '" << this->item_->getPickupIdentifier() << '\'' << std::endl; 86 86 this->item_->destroy(); 87 87 } … … 112 112 drop->createTimer(); 113 113 114 COUT(3) << "Created DroppedItem for '" << item->getPickupIdentifier() << "' at (" << position.x << "," << position.y << ","<< position.z << ")." << std::endl;114 COUT(3) << "Created DroppedItem for '" << item->getPickupIdentifier() << "' at (" << position.x << ',' << position.y << ',' << position.z << ")." << std::endl; 115 115 116 116 return drop; -
code/trunk/src/orxonox/pickup/ModifierPickup.cc
r5929 r6417 91 91 for (it = this->additiveModifiers_.begin(); it != this->additiveModifiers_.end(); it++) 92 92 { 93 pawn->getPickups().addAdditiveModifier( (*it).first, (*it).second);93 pawn->getPickups().addAdditiveModifier(it->first, it->second); 94 94 } 95 95 96 96 for (it = this->multiplicativeModifiers_.begin(); it != this->multiplicativeModifiers_.end(); it++) 97 97 { 98 pawn->getPickups().addMultiplicativeModifier( (*it).first, (*it).second);98 pawn->getPickups().addMultiplicativeModifier(it->first, it->second); 99 99 } 100 100 … … 128 128 for (it = this->additiveModifiers_.begin(); it != this->additiveModifiers_.end(); it++) 129 129 { 130 pawn->getPickups().removeAdditiveModifier( (*it).first, (*it).second);130 pawn->getPickups().removeAdditiveModifier(it->first, it->second); 131 131 } 132 132 133 133 for (it = this->multiplicativeModifiers_.begin(); it != this->multiplicativeModifiers_.end(); it++) 134 134 { 135 pawn->getPickups().removeMultiplicativeModifier( (*it).first, (*it).second);135 pawn->getPickups().removeMultiplicativeModifier(it->first, it->second); 136 136 } 137 137 … … 162 162 std::map<ModifierType::Value, float>::const_iterator it = this->additiveModifiers_.find(type); 163 163 if (it != this->additiveModifiers_.end()) 164 return (*it).second;164 return it->second; 165 165 else 166 166 return 0.0f; … … 175 175 std::map<ModifierType::Value, float>::const_iterator it = this->multiplicativeModifiers_.find(type); 176 176 if (it != this->multiplicativeModifiers_.end()) 177 return (*it).second;177 return it->second; 178 178 else 179 179 return 1.0f; -
code/trunk/src/orxonox/pickup/ModifierPickup.h
r5929 r6417 129 129 130 130 void timerCallback(Pawn* pawn); //!< Method called when the timer runs out. 131 131 132 132 private: 133 133 float getAdditiveModifier(ModifierType::Value type) const; //!< Get the additive modifier for a given ModifierType. -
code/trunk/src/orxonox/pickup/PickupCollection.cc
r5781 r6417 100 100 for (std::multimap<std::string, BaseItem*>::iterator it = this->items_.begin(); it != this->items_.end(); it++) 101 101 { 102 if( (*it).second && (*it).second->getOwner())103 (*it).second->dropped((*it).second->getOwner());102 if(it->second && it->second->getOwner()) 103 it->second->dropped(it->second->getOwner()); 104 104 } 105 105 this->currentUsable_ = NULL; … … 124 124 for (std::multimap<std::string, BaseItem*>::iterator it = bounds.first; it != bounds.second && it != this->items_.end(); it++) 125 125 { 126 if ( (*it).second == item)126 if (it->second == item) 127 127 { 128 128 return true; … … 176 176 for (std::multimap<std::string, BaseItem*>::iterator it = bounds.first; it != bounds.second && it != this->items_.end(); it++) 177 177 { 178 if ( (*it).second == item)178 if (it->second == item) 179 179 { 180 180 this->items_.erase(it); … … 217 217 for (std::multimap<ModifierType::Value, float>::iterator it = range.first; it != range.second && it != this->additiveModifiers_.end(); it++) 218 218 { 219 v += (*it).second;219 v += it->second; 220 220 } 221 221 … … 232 232 for (std::multimap<ModifierType::Value, float>::iterator it = range.first; it != range.second && it != this->additiveModifiers_.end(); it++) 233 233 { 234 if ( (*it).second == value)234 if (it->second == value) 235 235 { 236 236 this->additiveModifiers_.erase(it); … … 260 260 for (std::multimap<ModifierType::Value, float>::iterator it = range.first; it != range.second && it != this->multiplicativeModifiers_.end(); it++) 261 261 { 262 v *= (*it).second;262 v *= it->second; 263 263 } 264 264 … … 275 275 for (std::multimap<ModifierType::Value, float>::iterator it = range.first; it != range.second && it != this->multiplicativeModifiers_.end(); it++) 276 276 { 277 if ( (*it).second == value)277 if (it->second == value) 278 278 { 279 279 this->multiplicativeModifiers_.erase(it); … … 335 335 for (std::multimap<std::string, BaseItem*>::iterator it = this->items_.begin(); it != this->items_.end(); it++) 336 336 { 337 if ( (*it).second->isA(ident))338 ret.push_back(orxonox_cast<EquipmentItem*>( (*it).second));337 if (it->second->isA(ident)) 338 ret.push_back(orxonox_cast<EquipmentItem*>(it->second)); 339 339 } 340 340 … … 352 352 for (std::multimap<std::string, BaseItem*>::iterator it = this->items_.begin(); it != this->items_.end(); it++) 353 353 { 354 if ( (*it).second->isA(ident))355 ret.push_back(orxonox_cast<PassiveItem*>( (*it).second));354 if (it->second->isA(ident)) 355 ret.push_back(orxonox_cast<PassiveItem*>(it->second)); 356 356 } 357 357 … … 369 369 for (std::multimap<std::string, BaseItem*>::iterator it = this->items_.begin(); it != this->items_.end(); it++) 370 370 { 371 if ( (*it).second->isA(ident))372 ret.push_back(orxonox_cast<UsableItem*>( (*it).second));371 if (it->second->isA(ident)) 372 ret.push_back(orxonox_cast<UsableItem*>(it->second)); 373 373 } 374 374 -
code/trunk/src/orxonox/pickup/PickupInventory.cc
r5781 r6417 86 86 { 87 87 if(PickupInventory::getSingleton()->isVisible()) { 88 GUIManager::getInstance().executeCode("hideGUI(\"PickupInventory\")"); 89 GUIManager::getInstance().executeCode("hideCursor()"); 90 InputManager::getInstance().leaveState("guiMouseOnly"); 91 } 92 else 93 { 94 GUIManager::getInstance().showGUI("PickupInventory"); 95 GUIManager::getInstance().executeCode("showCursor()"); 96 InputManager::getInstance().enterState("guiMouseOnly"); 88 GUIManager::hideGUI("PickupInventory"); 89 } 90 else 91 { 92 GUIManager::showGUI("PickupInventory"); 97 93 } 98 94 PickupInventory::getSingleton()->setVisible(!PickupInventory::getSingleton()->isVisible()); … … 200 196 return ""; 201 197 202 std::stringname = "pickup_" + item->getGUIImage();198 const std::string& name = "pickup_" + item->getGUIImage(); 203 199 204 200 if(!CEGUI::ImagesetManager::getSingletonPtr()->isImagesetPresent(name)) … … 207 203 } 208 204 209 return "set:" + name + " image:full_image";205 return ("set:" + name + " image:full_image"); 210 206 } 211 207 … … 336 332 txt->setVisible(true); 337 333 txt->setProperty("Text", item->getGUIText()); 338 txt->setProperty("TextColours", "tl:" + textColour + " tr:" + textColour + " bl:" + textColour + " br:" + textColour + "");339 340 std::stringimage = PickupInventory::getImageForItem(item);334 txt->setProperty("TextColours", "tl:" + textColour + " tr:" + textColour + " bl:" + textColour + " br:" + textColour); 335 336 const std::string& image = PickupInventory::getImageForItem(item); 341 337 btn->setVisible(true); 342 338 btn->setProperty("NormalImage", image); -
code/trunk/src/orxonox/pickup/PickupSpawner.cc
r5929 r6417 96 96 // & load the GUI itself too, along with some empty windows 97 97 // = even less delays 98 GUIManager:: getInstance().showGUI("PickupInventory");99 GUIManager:: getInstance().executeCode("hideGUI(\"PickupInventory\")");98 GUIManager::showGUI("PickupInventory"); 99 GUIManager::hideGUI("PickupInventory"); 100 100 PickupInventory::getSingleton(); 101 101 } -
code/trunk/src/orxonox/pickup/UsableItem.cc
r5781 r6417 26 26 * 27 27 */ 28 28 29 29 /** 30 30 @file … … 41 41 @param creator Pointer to the object which created this item. 42 42 */ 43 UsableItem::UsableItem(BaseObject* creator) : BaseItem(creator) 43 UsableItem::UsableItem(BaseObject* creator) : BaseItem(creator) 44 44 { 45 45 RegisterObject(UsableItem);
Note: See TracChangeset
for help on using the changeset viewer.