Changeset 10624 for code/trunk/src/orxonox/worldentities
- Timestamp:
- Oct 4, 2015, 9:12:21 PM (9 years ago)
- Location:
- code/trunk
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
-
code/trunk/src/orxonox/worldentities/ControllableEntity.cc
r9799 r10624 36 36 #include "core/GameMode.h" 37 37 #include "core/XMLPort.h" 38 #include "network/NetworkFunction .h"38 #include "network/NetworkFunctionIncludes.h" 39 39 40 40 #include "Scene.h" … … 108 108 this->camera_->destroy(); 109 109 110 for (std::list<S martPtr<CameraPosition> >::const_iterator it = this->cameraPositions_.begin(); it != this->cameraPositions_.end(); ++it)110 for (std::list<StrongPtr<CameraPosition> >::const_iterator it = this->cameraPositions_.begin(); it != this->cameraPositions_.end(); ++it) 111 111 (*it)->destroy(); 112 112 … … 165 165 { 166 166 unsigned int i = 0; 167 for (std::list<S martPtr<CameraPosition> >::const_iterator it = this->cameraPositions_.begin(); it != this->cameraPositions_.end(); ++it)167 for (std::list<StrongPtr<CameraPosition> >::const_iterator it = this->cameraPositions_.begin(); it != this->cameraPositions_.end(); ++it) 168 168 { 169 169 if (i == index) … … 180 180 181 181 unsigned int counter = 0; 182 for (std::list<S martPtr<CameraPosition> >::const_iterator it = this->cameraPositions_.begin(); it != this->cameraPositions_.end(); ++it)182 for (std::list<StrongPtr<CameraPosition> >::const_iterator it = this->cameraPositions_.begin(); it != this->cameraPositions_.end(); ++it) 183 183 { 184 184 if ((*it) == this->currentCameraPosition_) … … 215 215 { 216 216 this->cameraPositions_.front()->attachCamera(this->camera_); 217 this->currentCameraPosition_ = this->cameraPositions_.front() .get();217 this->currentCameraPosition_ = this->cameraPositions_.front(); 218 218 } 219 219 else if (this->cameraPositions_.size() > 0) 220 220 { 221 for (std::list<S martPtr<CameraPosition> >::const_iterator it = this->cameraPositions_.begin(); it != this->cameraPositions_.end(); ++it)221 for (std::list<StrongPtr<CameraPosition> >::const_iterator it = this->cameraPositions_.begin(); it != this->cameraPositions_.end(); ++it) 222 222 { 223 223 if ((*it) == this->camera_->getParent()) … … 307 307 else 308 308 { 309 callMemberNetworkFunction( ControllableEntity,fire, this->getObjectID(), 0, firemode);309 callMemberNetworkFunction(&ControllableEntity::fire, this->getObjectID(), 0, firemode); 310 310 } 311 311 } … … 323 323 if ( target != 0 ) 324 324 { 325 callMemberNetworkFunction( ControllableEntity,setTargetInternal, this->getObjectID(), 0, target->getObjectID() );325 callMemberNetworkFunction(&ControllableEntity::setTargetInternal, this->getObjectID(), 0, target->getObjectID() ); 326 326 } 327 327 else 328 328 { 329 callMemberNetworkFunction( ControllableEntity,setTargetInternal, this->getObjectID(), 0, OBJECTID_UNKNOWN );329 callMemberNetworkFunction(&ControllableEntity::setTargetInternal, this->getObjectID(), 0, OBJECTID_UNKNOWN ); 330 330 } 331 331 } … … 477 477 if (parent) 478 478 { 479 for (std::list<S martPtr<CameraPosition> >::iterator it = this->cameraPositions_.begin(); it != this->cameraPositions_.end(); ++it)479 for (std::list<StrongPtr<CameraPosition> >::iterator it = this->cameraPositions_.begin(); it != this->cameraPositions_.end(); ++it) 480 480 if ((*it)->getIsAbsolute()) 481 481 parent->attach((*it)); -
code/trunk/src/orxonox/worldentities/ControllableEntity.h
r10437 r10624 121 121 void addCameraPosition(CameraPosition* position); 122 122 CameraPosition* getCameraPosition(unsigned int index) const; 123 inline const std::list<S martPtr<CameraPosition> >& getCameraPositions() const123 inline const std::list<StrongPtr<CameraPosition> >& getCameraPositions() const 124 124 { return this->cameraPositions_; } 125 125 unsigned int getCurrentCameraIndex() const; … … 162 162 163 163 inline Controller* getController() const 164 { return this->controller_ .get(); }164 { return this->controller_; } 165 165 void setController(Controller* val); 166 166 … … 168 168 virtual void setTarget( WorldEntity* target ); 169 169 virtual WorldEntity* getTarget() 170 { return this->target_ .get(); }170 { return this->target_; } 171 171 void setTargetInternal( uint32_t targetID ); 172 172 … … 242 242 bool bMouseLook_; 243 243 float mouseLookSpeed_; 244 std::list<S martPtr<CameraPosition> > cameraPositions_;244 std::list<StrongPtr<CameraPosition> > cameraPositions_; 245 245 CameraPosition* currentCameraPosition_; 246 246 std::string cameraPositionTemplate_; -
code/trunk/src/orxonox/worldentities/WorldEntity.cc
r10288 r10624 61 61 BOOST_STATIC_ASSERT((int)Ogre::Node::TS_WORLD == (int)WorldEntity::World); 62 62 63 RegisterAbstractClass(WorldEntity).inheritsFrom (Class(BaseObject)).inheritsFrom(Class(Synchronisable));63 RegisterAbstractClass(WorldEntity).inheritsFrom<BaseObject>().inheritsFrom<Synchronisable>(); 64 64 65 65 /** … … 130 130 WorldEntity* entity = *it; 131 131 132 // do this for all children, because even if getDeleteWithParent() returns true a child might still stay active due to s martpointers pointing to it132 // do this for all children, because even if getDeleteWithParent() returns true a child might still stay active due to strong pointers pointing to it 133 133 entity->setPosition(entity->getWorldPosition()); 134 134 this->detach(entity); // detach also erases the element from the children set -
code/trunk/src/orxonox/worldentities/pawns/Destroyer.cc
r9667 r10624 40 40 RegisterObject(Destroyer); 41 41 42 UnderAttack* gametype = orxonox_cast<UnderAttack*>(this->getGametype() .get());42 UnderAttack* gametype = orxonox_cast<UnderAttack*>(this->getGametype()); 43 43 if (gametype) 44 44 { -
code/trunk/src/orxonox/worldentities/pawns/ModularSpaceShip.cc
r10270 r10624 37 37 #include "util/Math.h" 38 38 #include "gametypes/Gametype.h" 39 #include "core/command/ConsoleCommand .h"39 #include "core/command/ConsoleCommandIncludes.h" 40 40 41 41 #include "items/ShipPart.h" … … 69 69 if (this->isInitialized()) 70 70 { 71 71 while (!this->partList_.empty()) 72 this->partList_[0]->destroy(); 72 73 } 73 74 } … … 177 178 if (it->second->getName() == name) 178 179 { 179 it->second-> setAlive(false);180 it->second->death(); 180 181 return; 181 182 } … … 196 197 if (it->second->getName() == name) 197 198 { 198 it->second-> setAlive(false);199 it->second->death(); 199 200 return; 200 201 } -
code/trunk/src/orxonox/worldentities/pawns/Pawn.cc
r10622 r10624 326 326 if (this->getGametype() && this->getGametype()->allowPawnDeath(this, this->lastHitOriginator_)) 327 327 { 328 // Set bAlive_ to false and wait for PawnManagerto do the destruction328 // Set bAlive_ to false and wait for destroyLater() to do the destruction 329 329 this->bAlive_ = false; 330 this->destroyLater(); 330 331 331 332 this->setDestroyWhenPlayerLeft(false); -
code/trunk/src/orxonox/worldentities/pawns/Spectator.cc
r9667 r10624 34 34 #include "core/GameMode.h" 35 35 #include "core/command/CommandExecutor.h" 36 #include "core/command/ConsoleCommand .h"36 #include "core/command/ConsoleCommandIncludes.h" 37 37 38 38 #include "tools/BillboardSet.h" -
code/trunk/src/orxonox/worldentities/pawns/TeamBaseMatchBase.cc
r9667 r10624 45 45 this->state_ = BaseState::Uncontrolled; 46 46 47 TeamBaseMatch* gametype = orxonox_cast<TeamBaseMatch*>(this->getGametype() .get());47 TeamBaseMatch* gametype = orxonox_cast<TeamBaseMatch*>(this->getGametype()); 48 48 if (gametype) 49 49 { … … 58 58 this->fireEvent(); 59 59 60 TeamDeathmatch* gametype = orxonox_cast<TeamDeathmatch*>(this->getGametype() .get());60 TeamDeathmatch* gametype = orxonox_cast<TeamDeathmatch*>(this->getGametype()); 61 61 if (!gametype) 62 62 return;
Note: See TracChangeset
for help on using the changeset viewer.