Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9059 in orxonox.OLD for trunk/src/world_entities


Ignore:
Timestamp:
Jul 3, 2006, 6:30:42 PM (19 years ago)
Author:
patrick
Message:

merged the network branche with the trunk

Location:
trunk/src/world_entities
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/world_entities/bsp_entity.cc

    r9003 r9059  
    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}
  • trunk/src/world_entities/bsp_entity.h

    r8490 r9059  
    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};
  • trunk/src/world_entities/player.h

    r9019 r9059  
    3131    bool              eject();
    3232    inline Playable*  getPlayable() const  { return this->playable; };
     33   
    3334
    3435     inline Hud& hud() { return this->_hud; };
  • trunk/src/world_entities/world_entity.cc

    r9008 r9059  
    738738  this->decreaseHealth(damage);
    739739
    740   PRINTF(5)("Hit me: %s now only %f/%f health\n", this->getClassName(), this->getHealth(), this->getHealthMax());
     740  PRINTF(0)("Hit me: %s now only %f/%f health\n", this->getClassName(), this->getHealth(), this->getHealthMax());
    741741
    742742  if( this->getHealth() > 0)
Note: See TracChangeset for help on using the changeset viewer.