Changeset 9507 in orxonox.OLD for branches/proxy/src/world_entities
- Timestamp:
- Jul 27, 2006, 1:59:30 PM (18 years ago)
- Location:
- branches/proxy/src/world_entities
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/proxy/src/world_entities/playable.cc
r9500 r9507 68 68 69 69 70 this->teamChangeHandler = registerVarId( new SynchronizeableInt( &this->teamId, &this->teamId, "team-id" ) ); 70 71 registerVar( new SynchronizeableInt( &score, &score, "score" ) ); 71 72 registerVar( new SynchronizeableBool( &bFire, &bFire, "bFire", PERMISSION_OWNER)); … … 524 525 "FirstPerson" 525 526 }; 527 528 529 /** 530 * handler for changes on registred vars 531 * @param id id's which changed 532 */ 533 void Playable::varChangeHandler( std::list< int > & id ) 534 { 535 if ( std::find( id.begin(), id.end(), this->teamChangeHandler) != id.end() ) 536 { 537 this->setTeam(this->teamId); 538 } 539 540 WorldEntity::varChangeHandler(id); 541 } -
branches/proxy/src/world_entities/playable.h
r9501 r9507 11 11 #include "event.h" 12 12 #include <vector> 13 #include <list> 13 14 14 15 #include "world_entities/weapons/weapon_manager.h" … … 43 44 44 45 virtual void loadParams(const TiXmlElement* root); 46 void varChangeHandler( std::list< int > & id ); 45 47 46 48 // Weapon and Pickups … … 61 63 /** @return a List of Events in PEV_* sytle */ 62 64 inline const std::vector<int>& getEventList() { return this->events; }; 63 virtual void setTeam(int teamID);64 65 65 66 … … 77 78 inline void setScore( int score ) { this->score = score; } 78 79 inline int getScore() { return this->score; } 80 inline void setTeamId( int teamId) { this->teamId = teamId;} 81 inline int getTeamId() const { return this->teamId; } 82 virtual void setTeam(int teamID); 83 79 84 80 85 void setEnterRadius(float radius) { this->enterRadius = radius; }; … … 121 126 122 127 int score; //!< players score 128 int teamChangeHandler; //!< handler id for team changes network sync 129 int teamId; //!< id of the current team 123 130 124 131 bool bDead; … … 128 135 float enterRadius; //!< How far one can be away from the Playable to enter it. 129 136 130 WorldEntity* collider;137 WorldEntity* collider; 131 138 }; 132 139 -
branches/proxy/src/world_entities/space_ships/turbine_hover.cc
r9502 r9507 276 276 else if (teamID == 1) 277 277 this->setBoostColor(Color::red); 278 279 // set the local team id, very important 280 this->setTeamId(teamID); 278 281 } 279 282
Note: See TracChangeset
for help on using the changeset viewer.