Changeset 11071 for code/trunk/src/orxonox/worldentities/pawns
- Timestamp:
- Jan 17, 2016, 10:29:21 PM (9 years ago)
- Location:
- code/trunk
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
-
code/trunk/src/orxonox/worldentities/pawns/FpsPlayer.cc
r9667 r11071 79 79 // FpsPlayer is always a physical object per default 80 80 // Be aware of this call: The collision type legality check will not reach derived classes! 81 this->setCollisionType(WorldEntity:: Dynamic);81 this->setCollisionType(WorldEntity::CollisionType::Dynamic); 82 82 // Get notification about collisions 83 83 this->enableCollisionCallback(); … … 130 130 bool FpsPlayer::isCollisionTypeLegal(WorldEntity::CollisionType type) const 131 131 { 132 if (type != WorldEntity:: Dynamic)132 if (type != WorldEntity::CollisionType::Dynamic) 133 133 { 134 134 orxout(internal_warning) << "Cannot tell a FpsPlayer not to be dynamic! Ignoring." << endl; … … 168 168 if (!this->isInMouseLook()) 169 169 { 170 this->yaw(Radian(this->yaw_ * this->getMouseLookSpeed()), WorldEntity:: Parent);170 this->yaw(Radian(this->yaw_ * this->getMouseLookSpeed()), WorldEntity::TransformSpace::Parent); 171 171 172 172 Radian pitch = this->cameraPositionRootNode_->getOrientation().getPitch(); … … 282 282 } 283 283 284 bool FpsPlayer::collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint)284 bool FpsPlayer::collidesAgainst(WorldEntity* otherObject, const btCollisionShape* ownCollisionShape, btManifoldPoint& contactPoint) 285 285 { 286 286 if (contactPoint.m_normalWorldOnB.y() > 0.6) -
code/trunk/src/orxonox/worldentities/pawns/FpsPlayer.h
r9667 r11071 69 69 virtual void fire(); 70 70 71 bool collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint);71 virtual bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* ownCollisionShape, btManifoldPoint& contactPoint) override; 72 72 73 73 virtual void addedWeaponPack(WeaponPack* wPack); -
code/trunk/src/orxonox/worldentities/pawns/ModularSpaceShip.cc
r10624 r11071 53 53 RegisterClass(ModularSpaceShip); 54 54 55 std::map<StaticEntity*, ShipPart*>* ModularSpaceShip::partMap_s = 0;55 std::map<StaticEntity*, ShipPart*>* ModularSpaceShip::partMap_s = nullptr; 56 56 57 57 ModularSpaceShip::ModularSpaceShip(Context* context) : SpaceShip(context) … … 94 94 for (unsigned int i=0; i < this->getAttachedObjects().size(); i++) 95 95 { 96 if (this->getAttachedObject(i) == NULL)96 if (this->getAttachedObject(i) == nullptr) 97 97 { 98 98 break; 99 99 } 100 100 // iterate through all attached parts 101 for( unsigned int j = 0; j < this->partList_.size(); j++)101 for(ShipPart* part : this->partList_) 102 102 { 103 103 // if the name of the part matches the name of the object, add the object to that parts entitylist (unless it was already done). 104 if(( this->partList_[j]->getName() == this->getAttachedObject(i)->getName()) && !this->partList_[j]->hasEntity(orxonox_cast<StaticEntity*>(this->getAttachedObject(i))))104 if((part->getName() == this->getAttachedObject(i)->getName()) && !part->hasEntity(orxonox_cast<StaticEntity*>(this->getAttachedObject(i)))) 105 105 { 106 106 // The Entity is added to the part's entityList_ 107 this->partList_[j]->addEntity(orxonox_cast<StaticEntity*>(this->getAttachedObject(i)));107 part->addEntity(orxonox_cast<StaticEntity*>(this->getAttachedObject(i))); 108 108 // An entry in the partMap_ is created, assigning the part to the entity. 109 this->addPartEntityAssignment((StaticEntity*)(this->getAttachedObject(i)), this->partList_[j]);109 this->addPartEntityAssignment((StaticEntity*)(this->getAttachedObject(i)), part); 110 110 } 111 111 } … … 146 146 ShipPart* ModularSpaceShip::getPartOfEntity(StaticEntity* entity) const 147 147 { 148 for ( std::map<StaticEntity*, ShipPart*>::const_iterator it = this->partMap_.begin(); it != this->partMap_.end(); ++it)149 { 150 if ( it->first == entity)151 return it->second;152 } 153 return NULL;148 for (const auto& mapEntry : this->partMap_) 149 { 150 if (mapEntry.first == entity) 151 return mapEntry.second; 152 } 153 return nullptr; 154 154 } 155 155 … … 160 160 void ModularSpaceShip::damage(float damage, float healthdamage, float shielddamage, Pawn* originator, const btCollisionShape* cs) 161 161 { 162 if (cs != NULL && this->getPartOfEntity((StaticEntity*)(cs->getUserPointer())) != NULL)162 if (cs != nullptr && this->getPartOfEntity((StaticEntity*)(cs->getUserPointer())) != nullptr) 163 163 this->getPartOfEntity((StaticEntity*)(cs->getUserPointer()))->handleHit(damage, healthdamage, shielddamage, originator); 164 164 else … … 174 174 void ModularSpaceShip::killShipPartStatic(std::string name) 175 175 { 176 for ( std::map<StaticEntity*, ShipPart*>::const_iterator it = ModularSpaceShip::partMap_s->begin(); it != ModularSpaceShip::partMap_s->end(); ++it)177 { 178 if ( it->second->getName() == name)179 { 180 it->second->death();176 for (const auto& mapEntry : *ModularSpaceShip::partMap_s) 177 { 178 if (mapEntry.second->getName() == name) 179 { 180 mapEntry.second->death(); 181 181 return; 182 182 } … … 193 193 void ModularSpaceShip::killShipPart(std::string name) 194 194 { 195 for ( std::map<StaticEntity*, ShipPart*>::const_iterator it = ModularSpaceShip::partMap_.begin(); it != ModularSpaceShip::partMap_.end(); ++it)196 { 197 if ( it->second->getName() == name)198 { 199 it->second->death();195 for (const auto& mapEntry : ModularSpaceShip::partMap_) 196 { 197 if (mapEntry.second->getName() == name) 198 { 199 mapEntry.second->death(); 200 200 return; 201 201 } … … 212 212 void ModularSpaceShip::addShipPart(ShipPart* part) 213 213 { 214 OrxAssert(part != NULL, "The ShipPart cannot be NULL.");214 OrxAssert(part != nullptr, "The ShipPart cannot be nullptr."); 215 215 this->partList_.push_back(part); 216 216 part->setParent(this); … … 222 222 Get the i-th ShipPart of the SpaceShip. 223 223 @return 224 Returns a pointer to the i-the ShipPart. NULLif there is no ShipPart with that index.224 Returns a pointer to the i-the ShipPart. nullptr if there is no ShipPart with that index. 225 225 */ 226 226 ShipPart* ModularSpaceShip::getShipPart(unsigned int index) 227 227 { 228 228 if(this->partList_.size() <= index) 229 return NULL;229 return nullptr; 230 230 else 231 231 return this->partList_[index]; … … 238 238 The name of the ShipPart to be returned. 239 239 @return 240 Pointer to the ShipPart with the given name, or NULLif not found.240 Pointer to the ShipPart with the given name, or nullptr if not found. 241 241 */ 242 242 ShipPart* ModularSpaceShip::getShipPartByName(std::string name) 243 243 { 244 for( std::vector<ShipPart*>::iterator it = this->partList_.begin(); it != this->partList_.end(); ++it)245 { 246 if(orxonox_cast<ShipPart*>( *it)->getName() == name)247 { 248 return orxonox_cast<ShipPart*>( *it);244 for(ShipPart* part : this->partList_) 245 { 246 if(orxonox_cast<ShipPart*>(part)->getName() == name) 247 { 248 return orxonox_cast<ShipPart*>(part); 249 249 } 250 250 } 251 251 orxout(internal_warning) << "Couldn't find ShipPart with name \"" << name << "\"." << endl; 252 return NULL;252 return nullptr; 253 253 } 254 254 … … 256 256 @brief 257 257 Check whether the SpaceShip has a particular Engine. 258 @param engine258 @param search 259 259 A pointer to the Engine to be checked. 260 260 */ 261 bool ModularSpaceShip::hasShipPart(ShipPart* part) const262 { 263 for( unsigned int i = 0; i < this->partList_.size(); i++)264 { 265 if( this->partList_[i] == part)261 bool ModularSpaceShip::hasShipPart(ShipPart* search) const 262 { 263 for(ShipPart* part : this->partList_) 264 { 265 if(part == search) 266 266 return true; 267 267 } -
code/trunk/src/orxonox/worldentities/pawns/ModularSpaceShip.h
r10262 r11071 109 109 ShipPart* getPartOfEntity(StaticEntity* entity) const; 110 110 111 virtual void damage(float damage, float healthdamage = 0.0f, float shielddamage = 0.0f, Pawn* originator = NULL, const btCollisionShape* cs = NULL);111 virtual void damage(float damage, float healthdamage = 0.0f, float shielddamage = 0.0f, Pawn* originator = nullptr, const btCollisionShape* cs = nullptr); 112 112 113 113 static void killShipPartStatic(std::string name); -
code/trunk/src/orxonox/worldentities/pawns/Pawn.cc
r11052 r11071 77 77 this->shieldRechargeWaitCountdown_ = 0; 78 78 79 this->lastHitOriginator_ = 0;79 this->lastHitOriginator_ = nullptr; 80 80 81 81 // set damage multiplier to default value 1, meaning nominal damage … … 86 86 this->aimPosition_ = Vector3::ZERO; 87 87 88 //this->explosionPartList_ = NULL;88 //this->explosionPartList_ = nullptr; 89 89 90 90 if (GameMode::isMaster()) … … 94 94 } 95 95 else 96 this->weaponSystem_ = 0;96 this->weaponSystem_ = nullptr; 97 97 98 98 this->setRadarObjectColour(ColourValue::Red); 99 this->setRadarObjectShape(RadarViewable:: Dot);99 this->setRadarObjectShape(RadarViewable::Shape::Dot); 100 100 101 101 this->registerVariables(); … … 112 112 else 113 113 { 114 this->explosionSound_ = 0;114 this->explosionSound_ = nullptr; 115 115 } 116 116 } … … 373 373 { 374 374 // delete the AIController // <-- TODO: delete? nothing is deleted here... should we delete the controller? 375 slave->setControllableEntity( 0);375 slave->setControllableEntity(nullptr); 376 376 377 377 // set a new master within the formation … … 468 468 return this->weaponSystem_->getWeaponSlot(index); 469 469 else 470 return 0;470 return nullptr; 471 471 } 472 472 … … 482 482 return this->weaponSystem_->getWeaponSet(index); 483 483 else 484 return 0;484 return nullptr; 485 485 } 486 486 … … 510 510 return this->weaponSystem_->getWeaponPack(index); 511 511 else 512 return 0; 513 } 514 515 std::vector<WeaponPack *> * Pawn::getAllWeaponPacks() 516 { 517 if (this->weaponSystem_) 518 return this->weaponSystem_->getAllWeaponPacks(); 519 else 520 return 0; 512 return nullptr; 521 513 } 522 514 … … 531 523 Munition* Pawn::getMunitionXML() const 532 524 { 533 return NULL;525 return nullptr; 534 526 } 535 527 … … 541 533 } 542 534 543 return NULL;535 return nullptr; 544 536 } 545 537 … … 564 556 bool Pawn::hasSlaves() 565 557 { 566 for (ObjectList<FormationController>::iterator it = 567 ObjectList<FormationController>::begin(); 568 it != ObjectList<FormationController>::end(); ++it ) 558 for (FormationController* controller : ObjectList<FormationController>()) 569 559 { 570 560 // checks if the pawn's controller has a slave 571 if (this->hasHumanController() && it->getMaster() == this->getPlayer()->getController())561 if (this->hasHumanController() && controller->getMaster() == this->getPlayer()->getController()) 572 562 return true; 573 563 } … … 577 567 // A function that returns a slave of the pawn's controller 578 568 Controller* Pawn::getSlave(){ 579 for (ObjectList<FormationController>::iterator it = 580 ObjectList<FormationController>::begin(); 581 it != ObjectList<FormationController>::end(); ++it ) 582 { 583 if (this->hasHumanController() && it->getMaster() == this->getPlayer()->getController()) 584 return it->getController(); 585 } 586 return 0; 569 for (FormationController* controller : ObjectList<FormationController>()) 570 { 571 if (this->hasHumanController() && controller->getMaster() == this->getPlayer()->getController()) 572 return controller->getController(); 573 } 574 return nullptr; 587 575 } 588 576 -
code/trunk/src/orxonox/worldentities/pawns/Pawn.h
r11052 r11071 63 63 virtual ~Pawn(); 64 64 65 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) ;66 virtual void XMLEventPort(Element& xmlelement, XMLPort::Mode mode) ;67 virtual void tick(float dt) ;65 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; 66 virtual void XMLEventPort(Element& xmlelement, XMLPort::Mode mode) override; 67 virtual void tick(float dt) override; 68 68 69 69 inline bool isAlive() const … … 71 71 72 72 73 v irtual void setHealth(float health);73 void setHealth(float health); 74 74 inline void addHealth(float health) 75 75 { this->setHealth(this->health_ + health); } … … 89 89 { return this->initialHealth_; } 90 90 91 v irtual void setShieldHealth(float shieldHealth);91 void setShieldHealth(float shieldHealth); 92 92 93 93 inline float getShieldHealth() … … 100 100 { return (this->getShieldHealth() > 0); } 101 101 102 v irtual void setMaxShieldHealth(float maxshieldhealth);102 void setMaxShieldHealth(float maxshieldhealth); 103 103 inline float getMaxShieldHealth() const 104 104 { return this->maxShieldHealth_; } … … 119 119 { return this->shieldAbsorption_; } 120 120 121 v irtual void setShieldRechargeRate(float shieldRechargeRate);121 void setShieldRechargeRate(float shieldRechargeRate); 122 122 inline float getShieldRechargeRate() const 123 123 { return this->shieldRechargeRate_; } 124 124 125 v irtual void setShieldRechargeWaitTime(float shieldRechargeWaitTime);125 void setShieldRechargeWaitTime(float shieldRechargeWaitTime); 126 126 inline float getShieldRechargeWaitTime() const 127 127 { return this->shieldRechargeWaitTime_; } … … 133 133 { this->shieldRechargeWaitCountdown_ = this->getShieldRechargeWaitTime(); } // TODO: Implement in Projectile.cc 134 134 135 v irtual void decreaseShieldRechargeCountdownTime(float dt);135 void decreaseShieldRechargeCountdownTime(float dt); 136 136 137 137 /** @brief Sets the state of the pawns vulnerability. @param bVulnerable */ … … 157 157 virtual void kill(); 158 158 159 virtual void fired(unsigned int firemode) ;159 virtual void fired(unsigned int firemode) override; 160 160 virtual void postSpawn(); 161 161 … … 170 170 void addWeaponPackXML(WeaponPack * wPack); 171 171 WeaponPack * getWeaponPack(unsigned int index) const; 172 std::vector<WeaponPack *> * getAllWeaponPacks();173 172 174 173 void addMunitionXML(Munition* munition); … … 201 200 202 201 203 virtual void startLocalHumanControl() ;202 virtual void startLocalHumanControl() override; 204 203 205 204 void setAimPosition( Vector3 position ) … … 208 207 { return this->aimPosition_; } 209 208 210 virtual const Vector3& getCarrierPosition(void) const 209 virtual const Vector3& getCarrierPosition(void) const override 211 210 { return this->getWorldPosition(); }; 212 211 213 virtual void changedVisibility() ;212 virtual void changedVisibility() override; 214 213 215 214 void setExplosionSound(const std::string& engineSound); 216 215 const std::string& getExplosionSound(); 217 216 218 virtualconst WeaponSystem* getWeaponSystem() const217 inline const WeaponSystem* getWeaponSystem() const 219 218 { return this->weaponSystem_; } 220 219 221 220 protected: 222 virtual void preDestroy() ;223 224 virtual void setPlayer(PlayerInfo* player) ;225 virtual void removePlayer() ;221 virtual void preDestroy() override; 222 223 virtual void setPlayer(PlayerInfo* player) override; 224 virtual void removePlayer() override; 226 225 227 226 virtual void death(); … … 231 230 virtual void spawneffect(); 232 231 233 virtual void damage(float damage, float healthdamage = 0.0f, float shielddamage = 0.0f, Pawn* originator = NULL, const btCollisionShape* cs = NULL);232 virtual void damage(float damage, float healthdamage = 0.0f, float shielddamage = 0.0f, Pawn* originator = nullptr, const btCollisionShape* cs = nullptr); 234 233 235 234 bool bAlive_; 236 235 bool bVulnerable_; ///< If false the pawn may not ged damaged 237 236 238 virtual std::vector<PickupCarrier*>* getCarrierChildren(void) const 237 virtual std::vector<PickupCarrier*>* getCarrierChildren(void) const override 239 238 { return new std::vector<PickupCarrier*>(); } 240 virtual PickupCarrier* getCarrierParent(void) const 241 { return NULL; }239 virtual PickupCarrier* getCarrierParent(void) const override 240 { return nullptr; } 242 241 243 242 -
code/trunk/src/orxonox/worldentities/pawns/SpaceShip.cc
r11052 r11071 48 48 RegisterClass(SpaceShip); 49 49 50 SpaceShip::SpaceShip(Context* context) : Pawn(context), boostBlur_( NULL)50 SpaceShip::SpaceShip(Context* context) : Pawn(context), boostBlur_(nullptr) 51 51 { 52 52 RegisterObject(SpaceShip); … … 80 80 // SpaceShip is always a physical object per default 81 81 // Be aware of this call: The collision type legality check will not reach derived classes! 82 this->setCollisionType(WorldEntity:: Dynamic);82 this->setCollisionType(WorldEntity::CollisionType::Dynamic); 83 83 // Get notification about collisions 84 84 this->enableCollisionCallback(); … … 145 145 bool SpaceShip::isCollisionTypeLegal(WorldEntity::CollisionType type) const 146 146 { 147 if (type != WorldEntity:: Dynamic)147 if (type != WorldEntity::CollisionType::Dynamic) 148 148 { 149 149 orxout(internal_warning) << "Cannot tell a SpaceShip not to be dynamic! Ignoring." << endl; … … 160 160 161 161 // Run the engines 162 for( std::vector<Engine*>::iterator it = this->engineList_.begin(); it != this->engineList_.end(); it++)163 (*it)->run(dt);162 for(Engine* engine : this->engineList_) 163 engine->run(dt); 164 164 165 165 if (this->hasLocalController()) … … 198 198 if(this->bEnableMotionBlur_) 199 199 { 200 if (this->boostBlur_ == NULL&& this->hasLocalController() && this->hasHumanController())200 if (this->boostBlur_ == nullptr && this->hasLocalController() && this->hasHumanController()) 201 201 { 202 202 this->boostBlur_ = new Shader(this->getScene()->getSceneManager()); … … 325 325 void SpaceShip::addEngine(orxonox::Engine* engine) 326 326 { 327 OrxAssert(engine != NULL, "The engine cannot be NULL.");327 OrxAssert(engine != nullptr, "The engine cannot be nullptr."); 328 328 this->engineList_.push_back(engine); 329 329 engine->addToSpaceShip(this); … … 333 333 @brief 334 334 Check whether the SpaceShip has a particular Engine. 335 @param engine335 @param search 336 336 A pointer to the Engine to be checked. 337 337 */ 338 bool SpaceShip::hasEngine(Engine* engine) const339 { 340 for( unsigned int i = 0; i < this->engineList_.size(); i++)341 { 342 if( this->engineList_[i] == engine)338 bool SpaceShip::hasEngine(Engine* search) const 339 { 340 for(Engine* engine : this->engineList_) 341 { 342 if(engine == search) 343 343 return true; 344 344 } … … 350 350 Get the i-th Engine of the SpaceShip. 351 351 @return 352 Returns a pointer to the i-the Engine. NULLif there is no Engine with that index.352 Returns a pointer to the i-the Engine. nullptr if there is no Engine with that index. 353 353 */ 354 354 Engine* SpaceShip::getEngine(unsigned int i) 355 355 { 356 356 if(this->engineList_.size() >= i) 357 return NULL;357 return nullptr; 358 358 else 359 359 return this->engineList_[i]; … … 366 366 The name of the engine to be returned. 367 367 @return 368 Pointer to the engine with the given name, or NULLif not found.368 Pointer to the engine with the given name, or nullptr if not found. 369 369 */ 370 370 Engine* SpaceShip::getEngineByName(const std::string& name) 371 371 { 372 for( size_t i = 0; i < this->engineList_.size(); ++i)373 if( this->engineList_[i]->getName() == name)374 return this->engineList_[i];372 for(Engine* engine : this->engineList_) 373 if(engine->getName() == name) 374 return engine; 375 375 376 376 orxout(internal_warning) << "Couldn't find Engine with name \"" << name << "\"." << endl; 377 return NULL;377 return nullptr; 378 378 } 379 379 … … 416 416 void SpaceShip::addSpeedFactor(float factor) 417 417 { 418 for( unsigned int i=0; i<this->engineList_.size(); i++)419 this->engineList_[i]->addSpeedMultiply(factor);418 for(Engine* engine : this->engineList_) 419 engine->addSpeedMultiply(factor); 420 420 } 421 421 … … 428 428 void SpaceShip::addSpeed(float speed) 429 429 { 430 for( unsigned int i=0; i<this->engineList_.size(); i++)431 this->engineList_[i]->addSpeedAdd(speed);430 for(Engine* engine : this->engineList_) 431 engine->addSpeedAdd(speed); 432 432 } 433 433 … … 456 456 { 457 457 float speed=0; 458 for( unsigned int i=0; i<this->engineList_.size(); i++)459 { 460 if( this->engineList_[i]->getMaxSpeedFront() > speed)461 speed = this->engineList_[i]->getMaxSpeedFront();458 for(Engine* engine : this->engineList_) 459 { 460 if(engine->getMaxSpeedFront() > speed) 461 speed = engine->getMaxSpeedFront(); 462 462 } 463 463 return speed; … … 485 485 void SpaceShip::changedEnableMotionBlur() 486 486 { 487 if (!this->bEnableMotionBlur_ && this->boostBlur_ != NULL)487 if (!this->bEnableMotionBlur_ && this->boostBlur_ != nullptr) 488 488 { 489 489 delete this->boostBlur_; 490 this->boostBlur_ = NULL;490 this->boostBlur_ = nullptr; 491 491 } 492 492 } … … 514 514 Camera* camera = this->getCamera(); 515 515 //Shaking Camera effect 516 if (camera != 0)516 if (camera != nullptr) 517 517 camera->setOrientation(Vector3::UNIT_X, angle); 518 518 … … 530 530 { 531 531 Camera* camera = CameraManager::getInstance().getActiveCamera(); 532 if(camera != NULL)532 if(camera != nullptr) 533 533 { 534 534 this->cameraOriginalPosition_ = camera->getPosition(); … … 546 546 { 547 547 Camera *camera = this->getCamera(); 548 if (camera == 0)548 if (camera == nullptr) 549 549 { 550 550 orxout(internal_warning) << "Failed to reset camera!" << endl; -
code/trunk/src/orxonox/worldentities/pawns/Spectator.cc
r10624 r11071 58 58 this->localVelocity_ = Vector3::ZERO; 59 59 this->setHudTemplate("spectatorhud"); 60 this->greetingFlare_ = 0;60 this->greetingFlare_ = nullptr; 61 61 62 62 this->setDestroyWhenPlayerLeft(true); -
code/trunk/src/orxonox/worldentities/pawns/TeamBaseMatchBase.cc
r10624 r11071 51 51 } 52 52 53 this->setRadarObjectShape(RadarViewable:: Triangle);53 this->setRadarObjectShape(RadarViewable::Shape::Triangle); 54 54 } 55 55 … … 80 80 81 81 std::set<WorldEntity*> attachments = this->getAttachedObjects(); 82 for ( std::set<WorldEntity*>::iterator it = attachments.begin(); it != attachments.end(); ++it)82 for (WorldEntity* attachment : attachments) 83 83 { 84 if ( (*it)->isA(Class(TeamColourable)))84 if (attachment->isA(Class(TeamColourable))) 85 85 { 86 TeamColourable* tc = orxonox_cast<TeamColourable*>( *it);86 TeamColourable* tc = orxonox_cast<TeamColourable*>(attachment); 87 87 tc->setTeamColour(colour); 88 88 } … … 92 92 93 93 // Call this so bots stop shooting at the base after they converted it 94 for ( ObjectList<ArtificialController>::iterator it = ObjectList<ArtificialController>::begin(); it != ObjectList<ArtificialController>::end(); ++it)95 it->abandonTarget(this);94 for (ArtificialController* controller : ObjectList<ArtificialController>()) 95 controller->abandonTarget(this); 96 96 } 97 97 } -
code/trunk/src/orxonox/worldentities/pawns/TeamBaseMatchBase.h
r9667 r11071 36 36 namespace orxonox 37 37 { 38 namespaceBaseState38 enum class BaseState 39 39 { 40 enum Value 41 { 42 Uncontrolled, 43 ControlTeam1, 44 ControlTeam2, 45 }; 46 } 40 Uncontrolled, 41 ControlTeam1, 42 ControlTeam2, 43 }; 47 44 48 45 … … 58 55 59 56 // Set the state of a base to whatever the argument of the function is 60 void setState(BaseState ::Valuestate)57 void setState(BaseState state) 61 58 { 62 59 this->state_ = state; … … 66 63 67 64 // Get the state of a base as a return value 68 BaseState ::ValuegetState() const65 BaseState getState() const 69 66 { 70 67 return this->state_; … … 75 72 void changeTeamColour(); 76 73 77 BaseState ::Valuestate_;74 BaseState state_; 78 75 }; 79 76 }
Note: See TracChangeset
for help on using the changeset viewer.