Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jan 17, 2016, 10:29:21 PM (9 years ago)
Author:
landauf
Message:

merged branch cpp11_v3 back to trunk

Location:
code/trunk
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/orxonox/worldentities/pawns/FpsPlayer.cc

    r9667 r11071  
    7979        // FpsPlayer is always a physical object per default
    8080        // 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);
    8282        // Get notification about collisions
    8383        this->enableCollisionCallback();
     
    130130    bool FpsPlayer::isCollisionTypeLegal(WorldEntity::CollisionType type) const
    131131    {
    132         if (type != WorldEntity::Dynamic)
     132        if (type != WorldEntity::CollisionType::Dynamic)
    133133        {
    134134            orxout(internal_warning) << "Cannot tell a FpsPlayer not to be dynamic! Ignoring." << endl;
     
    168168            if (!this->isInMouseLook())
    169169            {
    170                 this->yaw(Radian(this->yaw_ * this->getMouseLookSpeed()), WorldEntity::Parent);
     170                this->yaw(Radian(this->yaw_ * this->getMouseLookSpeed()), WorldEntity::TransformSpace::Parent);
    171171
    172172                Radian pitch = this->cameraPositionRootNode_->getOrientation().getPitch();
     
    282282    }
    283283
    284     bool FpsPlayer::collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint)
     284    bool FpsPlayer::collidesAgainst(WorldEntity* otherObject, const btCollisionShape* ownCollisionShape, btManifoldPoint& contactPoint)
    285285    {
    286286        if (contactPoint.m_normalWorldOnB.y() > 0.6)
  • code/trunk/src/orxonox/worldentities/pawns/FpsPlayer.h

    r9667 r11071  
    6969            virtual void fire();
    7070
    71             bool collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint);
     71            virtual bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* ownCollisionShape, btManifoldPoint& contactPoint) override;
    7272
    7373            virtual void addedWeaponPack(WeaponPack* wPack);
  • code/trunk/src/orxonox/worldentities/pawns/ModularSpaceShip.cc

    r10624 r11071  
    5353    RegisterClass(ModularSpaceShip);
    5454
    55     std::map<StaticEntity*, ShipPart*>* ModularSpaceShip::partMap_s = 0;
     55    std::map<StaticEntity*, ShipPart*>* ModularSpaceShip::partMap_s = nullptr;
    5656
    5757    ModularSpaceShip::ModularSpaceShip(Context* context) : SpaceShip(context)
     
    9494        for (unsigned int i=0; i < this->getAttachedObjects().size(); i++)
    9595        {
    96             if (this->getAttachedObject(i) == NULL)
     96            if (this->getAttachedObject(i) == nullptr)
    9797            {
    9898                break;
    9999            }
    100100            // iterate through all attached parts
    101             for(unsigned int j = 0; j < this->partList_.size(); j++)
     101            for(ShipPart* part : this->partList_)
    102102            {
    103103                // 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))))
    105105                {
    106106                    // 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)));
    108108                    // 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);
    110110                }
    111111            }
     
    146146    ShipPart* ModularSpaceShip::getPartOfEntity(StaticEntity* entity) const
    147147    {
    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;
    154154    }
    155155
     
    160160    void ModularSpaceShip::damage(float damage, float healthdamage, float shielddamage, Pawn* originator, const btCollisionShape* cs)
    161161    {
    162         if (cs != NULL && this->getPartOfEntity((StaticEntity*)(cs->getUserPointer())) != NULL)
     162        if (cs != nullptr && this->getPartOfEntity((StaticEntity*)(cs->getUserPointer())) != nullptr)
    163163            this->getPartOfEntity((StaticEntity*)(cs->getUserPointer()))->handleHit(damage, healthdamage, shielddamage, originator);
    164164        else
     
    174174    void ModularSpaceShip::killShipPartStatic(std::string name)
    175175    {
    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();
    181181                return;
    182182            }
     
    193193    void ModularSpaceShip::killShipPart(std::string name)
    194194    {
    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();
    200200                return;
    201201            }
     
    212212    void ModularSpaceShip::addShipPart(ShipPart* part)
    213213    {
    214         OrxAssert(part != NULL, "The ShipPart cannot be NULL.");
     214        OrxAssert(part != nullptr, "The ShipPart cannot be nullptr.");
    215215        this->partList_.push_back(part);
    216216        part->setParent(this);
     
    222222        Get the i-th ShipPart of the SpaceShip.
    223223    @return
    224         Returns a pointer to the i-the ShipPart. NULL if 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.
    225225    */
    226226    ShipPart* ModularSpaceShip::getShipPart(unsigned int index)
    227227    {
    228228        if(this->partList_.size() <= index)
    229             return NULL;
     229            return nullptr;
    230230        else
    231231            return this->partList_[index];
     
    238238        The name of the ShipPart to be returned.
    239239    @return
    240         Pointer to the ShipPart with the given name, or NULL if not found.
     240        Pointer to the ShipPart with the given name, or nullptr if not found.
    241241    */
    242242    ShipPart* ModularSpaceShip::getShipPartByName(std::string name)
    243243    {
    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);
    249249            }
    250250        }
    251251        orxout(internal_warning) << "Couldn't find ShipPart with name \"" << name << "\"." << endl;
    252         return NULL;
     252        return nullptr;
    253253    }
    254254
     
    256256    @brief
    257257        Check whether the SpaceShip has a particular Engine.
    258     @param engine
     258    @param search
    259259        A pointer to the Engine to be checked.
    260260    */
    261     bool ModularSpaceShip::hasShipPart(ShipPart* part) const
    262     {
    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)
    266266                return true;
    267267        }
  • code/trunk/src/orxonox/worldentities/pawns/ModularSpaceShip.h

    r10262 r11071  
    109109            ShipPart* getPartOfEntity(StaticEntity* entity) const;
    110110
    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);
    112112
    113113            static void killShipPartStatic(std::string name);
  • code/trunk/src/orxonox/worldentities/pawns/Pawn.cc

    r11052 r11071  
    7777        this->shieldRechargeWaitCountdown_ = 0;
    7878
    79         this->lastHitOriginator_ = 0;
     79        this->lastHitOriginator_ = nullptr;
    8080
    8181        // set damage multiplier to default value 1, meaning nominal damage
     
    8686        this->aimPosition_ = Vector3::ZERO;
    8787
    88         //this->explosionPartList_ = NULL;
     88        //this->explosionPartList_ = nullptr;
    8989
    9090        if (GameMode::isMaster())
     
    9494        }
    9595        else
    96             this->weaponSystem_ = 0;
     96            this->weaponSystem_ = nullptr;
    9797
    9898        this->setRadarObjectColour(ColourValue::Red);
    99         this->setRadarObjectShape(RadarViewable::Dot);
     99        this->setRadarObjectShape(RadarViewable::Shape::Dot);
    100100
    101101        this->registerVariables();
     
    112112        else
    113113        {
    114             this->explosionSound_ = 0;
     114            this->explosionSound_ = nullptr;
    115115        }
    116116    }
     
    373373                    {
    374374                        // delete the AIController // <-- TODO: delete? nothing is deleted here... should we delete the controller?
    375                         slave->setControllableEntity(0);
     375                        slave->setControllableEntity(nullptr);
    376376
    377377                        // set a new master within the formation
     
    468468            return this->weaponSystem_->getWeaponSlot(index);
    469469        else
    470             return 0;
     470            return nullptr;
    471471    }
    472472
     
    482482            return this->weaponSystem_->getWeaponSet(index);
    483483        else
    484             return 0;
     484            return nullptr;
    485485    }
    486486
     
    510510            return this->weaponSystem_->getWeaponPack(index);
    511511        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;
    521513    }
    522514
     
    531523    Munition* Pawn::getMunitionXML() const
    532524    {
    533         return NULL;
     525        return nullptr;
    534526    }
    535527
     
    541533        }
    542534
    543         return NULL;
     535        return nullptr;
    544536    }
    545537
     
    564556    bool Pawn::hasSlaves()
    565557    {
    566         for (ObjectList<FormationController>::iterator it =
    567              ObjectList<FormationController>::begin();
    568              it != ObjectList<FormationController>::end(); ++it )
     558        for (FormationController* controller : ObjectList<FormationController>())
    569559        {
    570560            // 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())
    572562                return true;
    573563        }
     
    577567    // A function that returns a slave of the pawn's controller
    578568    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;
    587575    }
    588576
  • code/trunk/src/orxonox/worldentities/pawns/Pawn.h

    r11052 r11071  
    6363            virtual ~Pawn();
    6464
    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;
    6868
    6969            inline bool isAlive() const
     
    7171
    7272
    73             virtual void setHealth(float health);
     73            void setHealth(float health);
    7474            inline void addHealth(float health)
    7575                { this->setHealth(this->health_ + health); }
     
    8989                { return this->initialHealth_; }
    9090
    91             virtual void setShieldHealth(float shieldHealth);
     91            void setShieldHealth(float shieldHealth);
    9292
    9393            inline float getShieldHealth()
     
    100100                { return (this->getShieldHealth() > 0); }
    101101
    102             virtual void setMaxShieldHealth(float maxshieldhealth);
     102            void setMaxShieldHealth(float maxshieldhealth);
    103103            inline float getMaxShieldHealth() const
    104104                { return this->maxShieldHealth_; }
     
    119119                { return this->shieldAbsorption_; }
    120120
    121             virtual void setShieldRechargeRate(float shieldRechargeRate);
     121            void setShieldRechargeRate(float shieldRechargeRate);
    122122            inline float getShieldRechargeRate() const
    123123                { return this->shieldRechargeRate_; }
    124124
    125             virtual void setShieldRechargeWaitTime(float shieldRechargeWaitTime);
     125            void setShieldRechargeWaitTime(float shieldRechargeWaitTime);
    126126            inline float getShieldRechargeWaitTime() const
    127127                { return this->shieldRechargeWaitTime_; }
     
    133133                { this->shieldRechargeWaitCountdown_ = this->getShieldRechargeWaitTime(); } // TODO: Implement in Projectile.cc
    134134
    135             virtual void decreaseShieldRechargeCountdownTime(float dt);
     135            void decreaseShieldRechargeCountdownTime(float dt);
    136136
    137137            /** @brief Sets the state of the pawns vulnerability. @param bVulnerable */
     
    157157            virtual void kill();
    158158
    159             virtual void fired(unsigned int firemode);
     159            virtual void fired(unsigned int firemode) override;
    160160            virtual void postSpawn();
    161161
     
    170170            void addWeaponPackXML(WeaponPack * wPack);
    171171            WeaponPack * getWeaponPack(unsigned int index) const;
    172             std::vector<WeaponPack *> * getAllWeaponPacks();
    173172
    174173            void addMunitionXML(Munition* munition);
     
    201200
    202201
    203             virtual void startLocalHumanControl();
     202            virtual void startLocalHumanControl() override;
    204203
    205204            void setAimPosition( Vector3 position )
     
    208207                { return this->aimPosition_; }
    209208
    210             virtual const Vector3& getCarrierPosition(void) const
     209            virtual const Vector3& getCarrierPosition(void) const override
    211210                { return this->getWorldPosition(); };
    212211
    213             virtual void changedVisibility();
     212            virtual void changedVisibility() override;
    214213
    215214            void setExplosionSound(const std::string& engineSound);
    216215            const std::string& getExplosionSound();
    217216
    218             virtual const WeaponSystem* getWeaponSystem() const
     217            inline const WeaponSystem* getWeaponSystem() const
    219218                { return this->weaponSystem_; }
    220219
    221220        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;
    226225
    227226            virtual void death();
     
    231230            virtual void spawneffect();
    232231
    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);
    234233
    235234            bool bAlive_;
    236235            bool bVulnerable_; ///< If false the pawn may not ged damaged
    237236
    238             virtual std::vector<PickupCarrier*>* getCarrierChildren(void) const
     237            virtual std::vector<PickupCarrier*>* getCarrierChildren(void) const override
    239238                { return new std::vector<PickupCarrier*>(); }
    240             virtual PickupCarrier* getCarrierParent(void) const
    241                 { return NULL; }
     239            virtual PickupCarrier* getCarrierParent(void) const override
     240                { return nullptr; }
    242241
    243242
  • code/trunk/src/orxonox/worldentities/pawns/SpaceShip.cc

    r11052 r11071  
    4848    RegisterClass(SpaceShip);
    4949
    50     SpaceShip::SpaceShip(Context* context) : Pawn(context), boostBlur_(NULL)
     50    SpaceShip::SpaceShip(Context* context) : Pawn(context), boostBlur_(nullptr)
    5151    {
    5252        RegisterObject(SpaceShip);
     
    8080        // SpaceShip is always a physical object per default
    8181        // 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);
    8383        // Get notification about collisions
    8484        this->enableCollisionCallback();
     
    145145    bool SpaceShip::isCollisionTypeLegal(WorldEntity::CollisionType type) const
    146146    {
    147         if (type != WorldEntity::Dynamic)
     147        if (type != WorldEntity::CollisionType::Dynamic)
    148148        {
    149149            orxout(internal_warning) << "Cannot tell a SpaceShip not to be dynamic! Ignoring." << endl;
     
    160160
    161161        // 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);
    164164
    165165        if (this->hasLocalController())
     
    198198            if(this->bEnableMotionBlur_)
    199199            {
    200                 if (this->boostBlur_ == NULL && this->hasLocalController() && this->hasHumanController())
     200                if (this->boostBlur_ == nullptr && this->hasLocalController() && this->hasHumanController())
    201201                {
    202202                    this->boostBlur_ = new Shader(this->getScene()->getSceneManager());
     
    325325    void SpaceShip::addEngine(orxonox::Engine* engine)
    326326    {
    327         OrxAssert(engine != NULL, "The engine cannot be NULL.");
     327        OrxAssert(engine != nullptr, "The engine cannot be nullptr.");
    328328        this->engineList_.push_back(engine);
    329329        engine->addToSpaceShip(this);
     
    333333    @brief
    334334        Check whether the SpaceShip has a particular Engine.
    335     @param engine
     335    @param search
    336336        A pointer to the Engine to be checked.
    337337    */
    338     bool SpaceShip::hasEngine(Engine* engine) const
    339     {
    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)
    343343                return true;
    344344        }
     
    350350        Get the i-th Engine of the SpaceShip.
    351351    @return
    352         Returns a pointer to the i-the Engine. NULL if 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.
    353353    */
    354354    Engine* SpaceShip::getEngine(unsigned int i)
    355355    {
    356356        if(this->engineList_.size() >= i)
    357             return NULL;
     357            return nullptr;
    358358        else
    359359            return this->engineList_[i];
     
    366366        The name of the engine to be returned.
    367367    @return
    368         Pointer to the engine with the given name, or NULL if not found.
     368        Pointer to the engine with the given name, or nullptr if not found.
    369369    */
    370370    Engine* SpaceShip::getEngineByName(const std::string& name)
    371371    {
    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;
    375375
    376376        orxout(internal_warning) << "Couldn't find Engine with name \"" << name << "\"." << endl;
    377         return NULL;
     377        return nullptr;
    378378    }
    379379
     
    416416    void SpaceShip::addSpeedFactor(float factor)
    417417    {
    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);
    420420    }
    421421
     
    428428    void SpaceShip::addSpeed(float speed)
    429429    {
    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);
    432432    }
    433433
     
    456456    {
    457457        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();
    462462        }
    463463        return speed;
     
    485485    void SpaceShip::changedEnableMotionBlur()
    486486    {
    487         if (!this->bEnableMotionBlur_ && this->boostBlur_ != NULL)
     487        if (!this->bEnableMotionBlur_ && this->boostBlur_ != nullptr)
    488488        {
    489489            delete this->boostBlur_;
    490             this->boostBlur_ = NULL;
     490            this->boostBlur_ = nullptr;
    491491        }
    492492    }
     
    514514            Camera* camera = this->getCamera();
    515515            //Shaking Camera effect
    516             if (camera != 0)
     516            if (camera != nullptr)
    517517                camera->setOrientation(Vector3::UNIT_X, angle);
    518518
     
    530530    {
    531531        Camera* camera = CameraManager::getInstance().getActiveCamera();
    532         if(camera != NULL)
     532        if(camera != nullptr)
    533533        {
    534534            this->cameraOriginalPosition_ = camera->getPosition();
     
    546546        {
    547547            Camera *camera = this->getCamera();
    548             if (camera == 0)
     548            if (camera == nullptr)
    549549            {
    550550                orxout(internal_warning) << "Failed to reset camera!" << endl;
  • code/trunk/src/orxonox/worldentities/pawns/Spectator.cc

    r10624 r11071  
    5858        this->localVelocity_ = Vector3::ZERO;
    5959        this->setHudTemplate("spectatorhud");
    60         this->greetingFlare_ = 0;
     60        this->greetingFlare_ = nullptr;
    6161
    6262        this->setDestroyWhenPlayerLeft(true);
  • code/trunk/src/orxonox/worldentities/pawns/TeamBaseMatchBase.cc

    r10624 r11071  
    5151        }
    5252
    53         this->setRadarObjectShape(RadarViewable::Triangle);
     53        this->setRadarObjectShape(RadarViewable::Shape::Triangle);
    5454    }
    5555
     
    8080
    8181        std::set<WorldEntity*> attachments = this->getAttachedObjects();
    82         for (std::set<WorldEntity*>::iterator it = attachments.begin(); it != attachments.end(); ++it)
     82        for (WorldEntity* attachment : attachments)
    8383        {
    84             if ((*it)->isA(Class(TeamColourable)))
     84            if (attachment->isA(Class(TeamColourable)))
    8585            {
    86                 TeamColourable* tc = orxonox_cast<TeamColourable*>(*it);
     86                TeamColourable* tc = orxonox_cast<TeamColourable*>(attachment);
    8787                tc->setTeamColour(colour);
    8888            }
     
    9292
    9393        // 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);
    9696    }
    9797}
  • code/trunk/src/orxonox/worldentities/pawns/TeamBaseMatchBase.h

    r9667 r11071  
    3636namespace orxonox
    3737{
    38     namespace BaseState
     38    enum class BaseState
    3939    {
    40         enum Value
    41         {
    42             Uncontrolled,
    43             ControlTeam1,
    44             ControlTeam2,
    45         };
    46     }
     40        Uncontrolled,
     41        ControlTeam1,
     42        ControlTeam2,
     43    };
    4744
    4845
     
    5855
    5956            // Set the state of a base to whatever the argument of the function is
    60             void setState(BaseState::Value state)
     57            void setState(BaseState state)
    6158            {
    6259                this->state_ = state;
     
    6663
    6764            // Get the state of a base as a return value
    68             BaseState::Value getState() const
     65            BaseState getState() const
    6966            {
    7067                return this->state_;
     
    7572            void changeTeamColour();
    7673
    77             BaseState::Value state_;
     74            BaseState state_;
    7875    };
    7976}
Note: See TracChangeset for help on using the changeset viewer.