Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9559 in orxonox.OLD for branches/proxy/src/lib


Ignore:
Timestamp:
Jul 28, 2006, 12:23:36 PM (18 years ago)
Author:
patrick
Message:

more documentation. clients now chooses the playable for the proxy:D working on this now

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/proxy/src/lib/network/player_stats.cc

    r9542 r9559  
    8484 */
    8585PlayerStats::~PlayerStats()
    86 {
    87 }
    88 
    89 
    90  /**
    91  * override this function to be notified on change
    92  * of your registred variables.
    93  * @param id id's which have changed
    94   */
     86{}
     87
     88
     89/**
     90* override this function to be notified on change
     91* of your registred variables.
     92* @param id id's which have changed
     93 */
    9594void PlayerStats::varChangeHandler( std::list< int > & id )
    9695{
     
    125124  }
    126125
    127   for ( std::list<BaseObject*>::const_iterator it = list->begin(); it != list->end(); it++ )
    128   {
    129     if ( dynamic_cast<PlayerStats*>(*it)->getUserId() == userId )
     126  for ( std::list<BaseObject*>::const_iterator it = list->
     127        begin();
     128        it != list->end();
     129        it++ )
     130  {
     131    if ( dynamic_cast<PlayerStats*>(*it)->
     132         getUserId() == userId )
    130133    {
    131134      return dynamic_cast<PlayerStats*>(*it);
     
    150153
    151154  this->playable = NULL;
    152   for ( std::list<BaseObject*>::const_iterator it = list->begin(); it != list->end(); it++ )
    153   {
    154     if ( dynamic_cast<Playable*>(*it)->getUniqueID() == uniqueId )
     155  for ( std::list<BaseObject*>::const_iterator it = list->
     156        begin();
     157        it != list->end();
     158        it++ )
     159  {
     160    if ( dynamic_cast<Playable*>(*it)->
     161         getUniqueID() == uniqueId )
    155162    {
    156163      this->playable = dynamic_cast<Playable*>(*it);
     
    161168  }
    162169
    163   if ( this->playable && userId == SharedNetworkData::getInstance()->getHostID() )
     170  if ( this->playable && userId == SharedNetworkData::getInstance()
     171       ->getHostID() )
    164172  {
    165173    State::getPlayer()->setPlayable( this->playable );
     
    212220}
    213221
     222/**
     223 * handler for the nick name
     224 * @param messageType type of the message
     225 * @param data  data of the message
     226 * @param dataLength length of the data
     227 * @param someData some additional data
     228 * @param senderId userId of the sender
     229 * @param destinationId userId of the rec
     230 * @return true if handled correctly
     231 */
    214232bool PlayerStats::changeNickHandler( MessageType messageType, byte * data, int dataLength, void * someData, int senderId, int destinationId  )
    215233{
     
    229247}
    230248
     249/**
     250 * sets the nick name from the shell
     251 * @param newNick new prefered nick name
     252 */
    231253void PlayerStats::shellNick( const std::string& newNick )
    232254{
     
    239261
    240262
     263/**
     264 * removes and delets all player stats
     265 */
    241266void PlayerStats::deleteAllPlayerStats( )
    242267{
     
    249274
    250275
     276/**
     277 * @return the score list of this player stat
     278 */
    251279ScoreList PlayerStats::getScoreList( )
    252280{
     
    260288  }
    261289
    262   for ( std::list<BaseObject*>::const_iterator it = list->begin(); it != list->end(); it++ )
     290  for ( std::list<BaseObject*>::const_iterator it = list->
     291        begin();
     292        it != list->end();
     293        it++ )
    263294  {
    264295    PlayerStats & stats = *dynamic_cast<PlayerStats*>(*it);
Note: See TracChangeset for help on using the changeset viewer.