Changeset 11499 for code/branches/HUD_HS16/src/orxonox/LevelInfo.cc
- Timestamp:
- Oct 23, 2017, 2:56:00 PM (7 years ago)
- Location:
- code/branches/HUD_HS16
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/HUD_HS16
- Property svn:mergeinfo changed
-
code/branches/HUD_HS16/src/orxonox/LevelInfo.cc
r11497 r11499 151 151 } 152 152 153 bool LevelInfoItem::addHighscore(const std::string& name, const int score)154 {155 std::stringstream stream;156 stream << name << "/:/" << score;157 bool success = this->highscores_.insert(stream.str()).second;158 if(success)159 this->highscoresUpdated();160 return success;161 }162 163 153 /** 164 154 @brief … … 201 191 } 202 192 203 void LevelInfoItem::highscoresUpdated(void)204 {205 std::stringstream stream;206 std::set<std::string>::iterator temp;207 for(std::set<std::string>::iterator it = this->highscores_.begin(); it != this->highscores_.end(); )208 {209 temp = it;210 if(++it == this->highscores_.end()) // If this is the last tag we don't add a comma.211 stream << *temp;212 else213 stream << *temp << ", ";214 }215 216 this->highscoresString_ = std::string(stream.str());217 }218 193 /** 219 194 @brief
Note: See TracChangeset
for help on using the changeset viewer.