- Timestamp:
- Mar 12, 2009, 5:13:34 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/questsystem5/src/orxonox/overlays/OverlayGroup.cc
r2662 r2779 107 107 void OverlayGroup::addElement(OrxonoxOverlay* element) 108 108 { 109 if (hudElements_.find(element->getName()) != hudElements_.end()) 109 this->insertElement(element, element->getName()); 110 } 111 112 /** 113 @brief 114 Adds an element to the map. 115 @param element 116 The element to be added. 117 @param name 118 The name of the element. 119 @remarks 120 The names of the OrxonoxOverlays have to be unique! 121 */ 122 void OverlayGroup::insertElement(OrxonoxOverlay* element, const std::string & name) 123 { 124 element->setName(name); 125 if (hudElements_.find(name) != hudElements_.end()) 110 126 { 111 127 COUT(1) << "Ambiguous names encountered while load the HUD overlays" << std::endl; … … 113 129 else 114 130 { 115 hudElements_[ element->getName()] = element;131 hudElements_[name] = element; 116 132 element->setVisible(this->isVisible()); 117 133 if (this->owner_) 118 134 element->setOwner(this->owner_); 119 135 } 136 } 137 138 /** 139 @brief 140 Removes an element from the map. 141 @param name 142 The name of the element that is removed. 143 @return 144 Returns true if there was such an element to remove, false if not. 145 */ 146 bool OverlayGroup::removeElement(const std::string & name) 147 { 148 if(this->hudElements_.erase(name) == 0) 149 return false; 150 return true; 120 151 } 121 152
Note: See TracChangeset
for help on using the changeset viewer.