Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 18, 2008, 10:00:17 PM (16 years ago)
Author:
scheusso
Message:

made clientinformation threadsafe and improved packetbuffer; wrote a static function SpaceShip *SpaceShip::getLocalShip. it returns the pointer to the ship that should be steered

Location:
code/branches/merge/src/orxonox/objects
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/merge/src/orxonox/objects/SpaceShip.cc

    r1306 r1318  
    6464    SpaceShip* SpaceShip::instance_s;
    6565
     66    SpaceShip *SpaceShip::getLocalShip(){
     67      Iterator<SpaceShip> it;
     68      for(it = ObjectList<SpaceShip>::start(); it; ++it){
     69        if((it)->server_ || ( network::Client::getSingleton() && network::Client::getSingleton()->getShipID()==it->objectID ) )
     70          return *it;
     71      }
     72      return NULL;
     73    }
     74   
    6675    SpaceShip::SpaceShip() :
    6776      //testvector_(0,0,0),
  • code/branches/merge/src/orxonox/objects/SpaceShip.h

    r1272 r1318  
    4444    {
    4545        public:
     46         
     47            static SpaceShip *getLocalShip();
     48           
    4649            SpaceShip();
    4750            ~SpaceShip();
Note: See TracChangeset for help on using the changeset viewer.