Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9053 in orxonox.OLD


Ignore:
Timestamp:
Jul 3, 2006, 5:32:50 PM (18 years ago)
Author:
rennerc
Message:

BspEntity sync

Location:
branches/multi_player_map/src/world_entities
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/multi_player_map/src/world_entities/bsp_entity.cc

    r9003 r9053  
    5353
    5454  this->bspManager = NULL;
    55   /**
    56    * @todo: Write CL_BSP_ENTITY INTO THE src/defs/class_id.h (your own definition)
    57    */
     55 
     56  this->name_handle = registerVarId( new SynchronizeableString( &this->name, &this->name_write, "name" ) );
     57 
     58  this->setSynchronized( true );
    5859}
    5960
     
    6263{
    6364  PRINTF(0)("+++++++++++ LOADING NAME %s\n", name.c_str());
     65 
     66  this->name = name;
    6467
    6568  // Check wether file exists....
     
    130133void BspEntity::collidesWith (WorldEntity* entity, const Vector& location)
    131134{}
     135
     136void BspEntity::varChangeHandler( std::list< int > & id )
     137{
     138  if ( std::find( id.begin(), id.end(), this->name_handle ) != id.end() )
     139  {
     140    this->setName( this->name_write );
     141  }
     142}
  • branches/multi_player_map/src/world_entities/bsp_entity.h

    r8490 r9053  
    2828
    2929  void init();
     30 
     31  virtual void varChangeHandler( std::list<int> & id );
    3032
    3133  virtual void draw() const;
     
    3840 private:
    3941   BspManager* bspManager;
     42   
     43   std::string name;                   //!< store name
     44   std::string name_write;             //!< temp variable to store name
     45   int name_handle;                    //!< handle for name
    4046
    4147};
Note: See TracChangeset for help on using the changeset viewer.