Changeset 9072 in orxonox.OLD for branches/presentation/src/lib
- Timestamp:
- Jul 3, 2006, 11:04:51 PM (19 years ago)
- Location:
- branches/presentation/src/lib/network
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/presentation/src/lib/network/player_stats.cc
r8708 r9072 238 238 } 239 239 240 241 242 ScoreList PlayerStats::getScoreList( ) 243 { 244 ScoreList result; 245 246 const std::list<BaseObject*> * list = ClassList::getList( CL_PLAYER_STATS ); 247 248 if ( !list ) 249 { 250 return result; 251 } 252 253 for ( std::list<BaseObject*>::const_iterator it = list->begin(); it != list->end(); it++ ) 254 { 255 PlayerStats & stats = *dynamic_cast<PlayerStats*>(*it); 256 257 TeamScoreList::iterator it = result[stats.getTeamId()].begin(); 258 259 while ( it != result[stats.getTeamId()].end() && stats.score > it->score ) 260 { 261 it++; 262 } 263 264 PlayerScore score; 265 score.name = stats.getNickName(); 266 score.score = stats.getScore(); 267 268 result[stats.getTeamId()].insert(it, score); 269 } 270 271 return result; 272 } -
branches/presentation/src/lib/network/player_stats.h
r8623 r9072 20 20 TEAM_SPECTATOR = -1 21 21 }; 22 23 struct PlayerScore 24 { 25 std::string name; 26 int score; 27 }; 28 typedef std::list<PlayerScore> TeamScoreList; 29 typedef std::map<int,TeamScoreList> ScoreList; 22 30 23 31 //! A class for storing player information … … 62 70 63 71 static void deleteAllPlayerStats(); 72 73 static ScoreList getScoreList(); 64 74 65 75 private:
Note: See TracChangeset
for help on using the changeset viewer.