Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9110 in orxonox.OLD for trunk/src/lib/network/player_stats.cc


Ignore:
Timestamp:
Jul 4, 2006, 11:18:41 AM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: merged the Presentation back

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/network/player_stats.cc

    r8708 r9110  
    238238}
    239239
     240
     241
     242ScoreList 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}
Note: See TracChangeset for help on using the changeset viewer.