Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9656 in orxonox.OLD for trunk/src/world_entities/playable.cc


Ignore:
Timestamp:
Aug 4, 2006, 11:01:28 PM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: merged the proxy bache back with no conflicts

File:
1 edited

Legend:

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

    r9406 r9656  
    6868
    6969
    70   registerVar( new SynchronizeableInt( &score, &score, "score" ) );
     70  this->teamChangeHandler = registerVarId( new SynchronizeableInt( &this->teamId, &this->teamId, "team-id", PERMISSION_MASTER_SERVER ) );
     71
     72  registerVar( new SynchronizeableInt( &score, &score, "score", PERMISSION_MASTER_SERVER ) );
    7173  registerVar( new SynchronizeableBool( &bFire, &bFire, "bFire", PERMISSION_OWNER));
    7274}
     
    139141bool Playable::addWeapon(Weapon* weapon, int configID, int slotID)
    140142{
     143  weapon->setOwner(this->getOwner());
     144
     145
    141146  if(this->weaponMan.addWeapon(weapon, configID, slotID))
    142147  {
     
    272277  return false;
    273278}
     279
     280
     281/**
     282 * @brief sets the TeamID and all the properties needed to be visible on the Playable
     283 * @param teamID: the new TeamID of the Entity
     284 */
     285void Playable::setTeam(int teamID)
     286{
     287  /// Derive this function to make it look different with differen groups.
     288  PRINTF(4)("No special team specific function implemented for %s::%s in Team %d\n", this->getClassCName(), this->getCName(), teamID);
     289}
     290
    274291
    275292/**
     
    512529  "FirstPerson"
    513530};
     531
     532
     533/**
     534 * handler for changes on registred vars
     535 * @param id id's which changed
     536 */
     537void Playable::varChangeHandler( std::list< int > & id )
     538{
     539  if ( std::find( id.begin(), id.end(), this->teamChangeHandler) != id.end() )
     540  {
     541    this->setTeam(this->teamId);
     542  }
     543
     544  WorldEntity::varChangeHandler(id);
     545}
Note: See TracChangeset for help on using the changeset viewer.