Changeset 161
- Timestamp:
- 09/27/2008 11:55:54 AM (3 years ago)
- Location:
- trunk/src
- Files:
-
- 2 edited
-
configuration.cpp (modified) (4 diffs)
-
configuration.h (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/configuration.cpp
r160 r161 158 158 void Configuration::saveHighscores(ofstream *file) 159 159 { 160 Highscore List::iterator it;160 HighscoresList::iterator it; 161 161 for (it = m_highscores.begin(); it!=m_highscores.end(); it++) { 162 162 (*file)<<(*it).score<<" "; … … 285 285 } 286 286 287 Highscore List::iterator it= m_highscores.end();287 HighscoresList::iterator it= m_highscores.end(); 288 288 if ((--it)->score<score) { 289 289 return true; … … 306 306 temp_item.name = name; 307 307 308 Highscore List::iterator it = m_highscores.begin();308 HighscoresList::iterator it = m_highscores.begin(); 309 309 while (it!=m_highscores.end()) { 310 310 if (it->score < temp_item.score) { … … 326 326 return place; 327 327 } 328 329 const HighscoresList* Configuration::getHighscores() const 330 { 331 const HighscoresList * ptr = &m_highscores; 332 return ptr; 333 } -
trunk/src/configuration.h
r160 r161 32 32 struct HighscoreItem; 33 33 34 typedef std::list<HighscoreItem> Highscore List;34 typedef std::list<HighscoreItem> HighscoresList; 35 35 36 36 static const char* DEFAULT_HIGHSCORE_SIZE = "20"; … … 62 62 Configuration *set(std::string key, std::string value); 63 63 64 /** 65 * Checks if a given score quallifies to the high score list 66 */ 64 67 bool isHighscore(int score); 68 69 /** 70 * Adds a given entry to the highscore list. 71 * \return the place in the highscore list for the new entry, or 72 * zero if it didn't quallify. 73 */ 65 74 int submitHighscore(int score, std::string name, std::string date); 75 76 const HighscoresList* getHighscores() const; 66 77 private: 67 78 /** … … 82 93 83 94 std::map<std::string, std::string> m_settings; 84 Highscore List m_highscores;95 HighscoresList m_highscores; 85 96 86 97 std::string m_file;
Note: See TracChangeset
for help on using the changeset viewer.
