Changeset 6101 for code/branches/particles2/src/orxonox/worldentities
- Timestamp:
- Nov 20, 2009, 1:02:09 AM (15 years ago)
- Location:
- code/branches/particles2/src/orxonox/worldentities
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/particles2/src/orxonox/worldentities/ControllableEntity.cc
r5929 r6101 36 36 #include "core/GameMode.h" 37 37 #include "core/XMLPort.h" 38 #include "network/NetworkFunction.h" 38 39 39 40 #include "Scene.h" … … 47 48 { 48 49 CreateFactory(ControllableEntity); 50 51 registerMemberNetworkFunction( ControllableEntity, fire ); 49 52 50 53 ControllableEntity::ControllableEntity(BaseObject* creator) : MobileEntity(creator) … … 217 220 this->cameraPositionRootNode_->roll(Radian(value.y * this->mouseLookSpeed_), Ogre::Node::TS_LOCAL); 218 221 } 222 223 void ControllableEntity::fire(unsigned int firemode) 224 { 225 if(GameMode::isMaster()) 226 { 227 this->fired(firemode); 228 } 229 else 230 { 231 callMemberNetworkFunction(ControllableEntity, fire, this->getObjectID(), 0, firemode); 232 } 233 } 219 234 220 235 void ControllableEntity::setPlayer(PlayerInfo* player) -
code/branches/particles2/src/orxonox/worldentities/ControllableEntity.h
r5929 r6101 84 84 { this->rotateRoll(Vector2(value, 0)); } 85 85 86 virtual void fire(unsigned int firemode) {} 86 void fire(unsigned int firemode); 87 virtual void fired(unsigned int firemode) {} 87 88 virtual void reload() {} 88 89 -
code/branches/particles2/src/orxonox/worldentities/pawns/Pawn.cc
r6078 r6101 52 52 CreateFactory(Pawn); 53 53 54 registerMemberNetworkFunction( Pawn, doFire );55 56 54 Pawn::Pawn(BaseObject* creator) : ControllableEntity(creator) 57 55 { … … 263 261 } 264 262 265 void Pawn::fire(unsigned int firemode) 266 { 267 this->doFire(firemode); 268 } 269 270 void Pawn::doFire(uint8_t firemode) 271 { 272 if(GameMode::isMaster()) 273 { 274 if (this->weaponSystem_) 275 this->weaponSystem_->fire(firemode); 276 } 277 else 278 { 279 callMemberNetworkFunction(Pawn, doFire, this->getObjectID(), 0, firemode); 280 if (this->weaponSystem_) 281 this->weaponSystem_->fire(firemode); 282 } 263 void Pawn::fired(unsigned int firemode) 264 { 265 if (this->weaponSystem_) 266 this->weaponSystem_->fire(firemode); 283 267 } 284 268 -
code/branches/particles2/src/orxonox/worldentities/pawns/Pawn.h
r6078 r6101 79 79 virtual void kill(); 80 80 81 virtual void fire (unsigned int firemode);81 virtual void fired(unsigned int firemode); 82 82 virtual void reload(); 83 virtual void doFire(uint8_t firemode);84 83 virtual void postSpawn(); 85 84 -
code/branches/particles2/src/orxonox/worldentities/pawns/Spectator.cc
r5929 r6101 189 189 } 190 190 191 void Spectator::fire (unsigned int firemode)191 void Spectator::fired(unsigned int firemode) 192 192 { 193 193 if (this->getPlayer()) -
code/branches/particles2/src/orxonox/worldentities/pawns/Spectator.h
r5781 r6101 55 55 virtual void rotateRoll(const Vector2& value); 56 56 57 virtual void fire (unsigned int firemode);57 virtual void fired(unsigned int firemode); 58 58 virtual void greet(); 59 59
Note: See TracChangeset
for help on using the changeset viewer.