Changeset 11768 for code/branches/Presentation_HS17_merge
- Timestamp:
- Feb 18, 2018, 4:27:43 PM (7 years ago)
- Location:
- code/branches/Presentation_HS17_merge/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/Presentation_HS17_merge/src/modules/superorxobros/SOBFigure.cc
r11766 r11768 385 385 if (reachedLvlEndState_ == 4) { 386 386 //Highscore 387 if (Highscore::exists()){ 388 int score = SOBGame->getPoints(); 389 if(score > Highscore::getInstance().getHighestScoreOfGame("Super Orxo Bros.")) 390 Highscore::getInstance().storeHighscore("Super Orxo Bros.",score); 391 SOBGame->newHighscore=1; 392 387 if (Highscore::exists()) 388 { 389 int score = SOBGame->getPoints(); 390 bool isHighScore = Highscore::getInstance().storeScore("Super Orxo Bros.", score, this->getPlayer()); 391 SOBGame->newHighscore = isHighScore; 393 392 } 394 393 lvlEnded_ = true; -
code/branches/Presentation_HS17_merge/src/orxonox/Highscore.cc
r11717 r11768 82 82 /** 83 83 * @brief stores a new highscore in the orxonox.ini file if the new score is better than the highest score so far. 84 * @returns true if the given score marks a new high score 84 85 */ 85 voidHighscore::storeScore(const std::string& level, int points, PlayerInfo* player)86 bool Highscore::storeScore(const std::string& level, int points, PlayerInfo* player) 86 87 { 87 88 if (points > this->getHighestScoreOfGame(level)) 88 89 { 89 90 ModifyConfigValue(highscores_, add, player->getName() + "./." + level + "./." + multi_cast<std::string>(points)); 91 return true; 90 92 } 93 else 94 return false; 91 95 } 92 96 } -
code/branches/Presentation_HS17_merge/src/orxonox/Highscore.h
r11717 r11768 49 49 void setConfigValues(); // Inherited function 50 50 51 voidstoreScore(const std::string& level, int points, PlayerInfo* player);51 bool storeScore(const std::string& level, int points, PlayerInfo* player); 52 52 int getHighestScoreOfGame(const std::string& game); 53 53
Note: See TracChangeset
for help on using the changeset viewer.