Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jan 10, 2016, 1:54:11 PM (9 years ago)
Author:
landauf
Message:

merged branch cpp11_v2 into cpp11_v3

Location:
code/branches/cpp11_v3
Files:
33 edited

Legend:

Unmodified
Added
Removed
  • code/branches/cpp11_v3

  • code/branches/cpp11_v3/src/modules/weapons/IceGunFreezer.cc

    r11052 r11054  
    101101
    102102        // Check if the freezer is attached to a parent and check if the parent is a SpaceShip
    103         if (parent != NULL && parent->isA(Class(SpaceShip)))
     103        if (parent != nullptr && parent->isA(Class(SpaceShip)))
    104104        {
    105105            freezedSpaceShip_ = orxonox_cast<SpaceShip*>(parent);
     
    118118    void IceGunFreezer::stopFreezing()
    119119    {
    120         if (freezedSpaceShip_ != NULL && freezeFactor_ != 0.0)
     120        if (freezedSpaceShip_ != nullptr && freezeFactor_ != 0.0)
    121121        {
    122122            freezedSpaceShip_->addSpeedFactor(1/freezeFactor_);
  • code/branches/cpp11_v3/src/modules/weapons/IceGunFreezer.h

    r11052 r11054  
    5555            IceGunFreezer(Context* context);
    5656            virtual ~IceGunFreezer();
    57             virtual void tick(float dt);
     57            virtual void tick(float dt) override;
    5858            virtual void startFreezing();
    5959            virtual void stopFreezing();
  • code/branches/cpp11_v3/src/modules/weapons/RocketController.cc

    r10258 r11054  
    3838#include "projectiles/SimpleRocket.h"
    3939#include "weaponmodes/SimpleRocketFire.h"
     40#include "core/CoreIncludes.h"
    4041
    4142namespace orxonox
  • code/branches/cpp11_v3/src/modules/weapons/RocketController.h

    r9667 r11054  
    5555            virtual ~RocketController();
    5656
    57             virtual void tick(float dt);
     57            virtual void tick(float dt) override;
    5858            /**
    5959            @brief Get the rocket that is controlled by this controller.
  • code/branches/cpp11_v3/src/modules/weapons/projectiles/BasicProjectile.cc

    r11052 r11054  
    8888                                    // The projectile is destroyed by its tick()-function (in the following tick).
    8989
    90             Pawn* victim = orxonox_cast<Pawn*>(otherObject); // If otherObject isn't a Pawn, then victim is NULL
     90            Pawn* victim = orxonox_cast<Pawn*>(otherObject); // If otherObject isn't a Pawn, then victim is nullptr
    9191
    9292            WorldEntity* entity = orxonox_cast<WorldEntity*>(this);
     
    146146    bool BasicProjectile::isObjectRelatedToShooter(WorldEntity* otherObject)
    147147    {
    148         for (WorldEntity* shooter = this->getShooter(); shooter != NULL; shooter = shooter->getParent())
     148        for (WorldEntity* shooter = this->getShooter(); shooter != nullptr; shooter = shooter->getParent())
    149149            if (otherObject == shooter)
    150150                return true;
    151         for (WorldEntity* object = otherObject; object != NULL; object = object->getParent())
     151        for (WorldEntity* object = otherObject; object != nullptr; object = object->getParent())
    152152            if (otherObject == this->getShooter())
    153153                return true;
  • code/branches/cpp11_v3/src/modules/weapons/projectiles/BillboardProjectile.h

    r10629 r11054  
    6161            virtual void setMaterial(const std::string& material);
    6262            virtual const std::string& getMaterial();
    63             virtual void changedVisibility();
     63            virtual void changedVisibility() override;
    6464
    6565        private:
  • code/branches/cpp11_v3/src/modules/weapons/projectiles/GravityBomb.h

    r10622 r11054  
    4141            GravityBomb(Context* context);
    4242            virtual ~GravityBomb();
    43             virtual void tick(float dt);
     43            virtual void tick(float dt) override;
    4444
    45             virtual bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* cs, btManifoldPoint& contactPoint);
     45            virtual bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* cs, btManifoldPoint& contactPoint) override;
    4646            void detonate();
    4747        private:
  • code/branches/cpp11_v3/src/modules/weapons/projectiles/GravityBombField.cc

    r11052 r11054  
    125125
    126126            //Check if any pawn is inside the shockwave and hit it with dammage proportional to the distance between explosion centre and pawn. Make sure, the same pawn is damaged only once.
    127             for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it != ObjectList<Pawn>::end(); ++it)
     127            for (Pawn* pawn : ObjectList<Pawn>())
    128128            {
    129                 Vector3 distanceVector = it->getWorldPosition()-this->getWorldPosition();
     129                Vector3 distanceVector = pawn->getWorldPosition()-this->getWorldPosition();
    130130                 //orxout(debug_output) << "Found Pawn:" << it->getWorldPosition() << endl;
    131131                if(distanceVector.length()< forceSphereRadius_)
    132132                {
    133133                    //orxout(debug_output) << "Force sphere radius is: " << forceSphereRadius_ << " Distance to Pawn is: " << distanceVector.length();
    134                     if (std::find(victimsAlreadyDamaged_.begin(),victimsAlreadyDamaged_.end(),*it) == victimsAlreadyDamaged_.end())
     134                    if (std::find(victimsAlreadyDamaged_.begin(),victimsAlreadyDamaged_.end(),pawn) == victimsAlreadyDamaged_.end())
    135135                    {
    136136                        //orxout(debug_output) << "Found Pawn to damage: " << it->getWorldPosition() << endl;
    137137                        float damage = FORCE_FIELD_EXPLOSION_DAMMAGE*(1-distanceVector.length()/EXPLOSION_RADIUS);
    138138                        //orxout(debug_output) << "Damage: " << damage << endl;
    139                         it->hit(shooter_, it->getWorldPosition(), NULL, damage, 0,0);
    140                         victimsAlreadyDamaged_.push_back(*it);
     139                        pawn->hit(shooter_, pawn->getWorldPosition(), nullptr, damage, 0,0);
     140                        victimsAlreadyDamaged_.push_back(pawn);
    141141                    }
    142142                }
  • code/branches/cpp11_v3/src/modules/weapons/projectiles/GravityBombField.h

    r10622 r11054  
    3939    GravityBombField(Context* context);
    4040    virtual ~GravityBombField();
    41     virtual void tick(float dt);
     41    virtual void tick(float dt) override;
    4242    virtual void destroy();
    4343
  • code/branches/cpp11_v3/src/modules/weapons/projectiles/IceGunProjectile.h

    r11052 r11054  
    6262
    6363        protected:
    64             virtual bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* cs, btManifoldPoint& contactPoint);
     64            virtual bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* cs, btManifoldPoint& contactPoint) override;
    6565            static const float particleDestructionDelay_;
    6666        private:
  • code/branches/cpp11_v3/src/modules/weapons/projectiles/LightningGunProjectile.h

    r9667 r11054  
    5858            virtual ~LightningGunProjectile() {}
    5959
    60             virtual void setMaterial(const std::string& material);
     60            virtual void setMaterial(const std::string& material) override;
    6161
    6262        private:
  • code/branches/cpp11_v3/src/modules/weapons/projectiles/MineProjectile.cc

    r11052 r11054  
    217217            {
    218218                // Damage all pawns within the damage radius
    219                 for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it != ObjectList<Pawn>::end(); ++it)
     219                for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>().begin(); it; ++it)
    220220                {
    221221                    Vector3 distanceVector = it->getWorldPosition()-this->getWorldPosition();
  • code/branches/cpp11_v3/src/modules/weapons/projectiles/ParticleProjectile.cc

    r10624 r11054  
    5858        }
    5959        else
    60             this->particles_ = 0;
     60            this->particles_ = nullptr;
    6161    }
    6262
  • code/branches/cpp11_v3/src/modules/weapons/projectiles/ParticleProjectile.h

    r9667 r11054  
    5353            ParticleProjectile(Context* context);
    5454            virtual ~ParticleProjectile();
    55             virtual void changedVisibility();
     55            virtual void changedVisibility() override;
    5656
    5757        private:
  • code/branches/cpp11_v3/src/modules/weapons/projectiles/Projectile.cc

    r10629 r11054  
    9494    void Projectile::setCollisionShapeRadius(float radius)
    9595    {
    96         if (collisionShape_ != NULL && radius > 0)
     96        if (collisionShape_ != nullptr && radius > 0)
    9797        {
    9898            collisionShape_->setRadius(radius);
  • code/branches/cpp11_v3/src/modules/weapons/projectiles/Projectile.h

    r11052 r11054  
    6464            void setConfigValues();
    6565
    66             virtual void tick(float dt);
    67             virtual bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* cs, btManifoldPoint& contactPoint);
     66            virtual void tick(float dt) override;
     67            virtual bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* cs, btManifoldPoint& contactPoint) override;
    6868
    6969        protected:
  • code/branches/cpp11_v3/src/modules/weapons/projectiles/Rocket.cc

    r11052 r11054  
    117117        else
    118118        {
    119             this->defSndWpnEngine_ = 0;
    120             this->defSndWpnLaunch_ = 0;
     119            this->defSndWpnEngine_ = nullptr;
     120            this->defSndWpnLaunch_ = nullptr;
    121121        }
    122122
  • code/branches/cpp11_v3/src/modules/weapons/projectiles/Rocket.h

    r11052 r11054  
    6262            virtual ~Rocket();
    6363
    64             virtual void tick(float dt); //!< Defines which actions the Rocket has to take in each tick.
     64            virtual void tick(float dt) override; //!< Defines which actions the Rocket has to take in each tick.
    6565
    66             virtual bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* cs, btManifoldPoint& contactPoint);
    67             virtual void destroyObject(void);
     66            virtual bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* cs, btManifoldPoint& contactPoint) override;
     67            virtual void destroyObject(void) override;
    6868            void destructionEffect();
    6969
    70             virtual void moveFrontBack(const Vector2& value) {}
    71             virtual void moveRightLeft(const Vector2& value) {}
    72             virtual void moveUpDown(const Vector2& value) {}
     70            virtual void moveFrontBack(const Vector2& value) override {}
     71            virtual void moveRightLeft(const Vector2& value) override {}
     72            virtual void moveUpDown(const Vector2& value) override {}
    7373
    74             virtual void rotateYaw(const Vector2& value);
    75             virtual void rotatePitch(const Vector2& value);
    76             virtual void rotateRoll(const Vector2& value);
     74            virtual void rotateYaw(const Vector2& value) override;
     75            virtual void rotatePitch(const Vector2& value) override;
     76            virtual void rotateRoll(const Vector2& value) override;
    7777
    7878            /**
     
    114114                { this->rotateRoll(Vector2(value, 0)); }
    115115
    116             virtual void setShooter(Pawn* shooter);
     116            virtual void setShooter(Pawn* shooter) override;
    117117
    118             virtual void fired(unsigned int firemode);
     118            virtual void fired(unsigned int firemode) override;
    119119
    120120            /**
  • code/branches/cpp11_v3/src/modules/weapons/projectiles/RocketOld.cc

    r10622 r11054  
    117117        else
    118118        {
    119             this->defSndWpnEngine_ = 0;
    120             this->defSndWpnLaunch_ = 0;
     119            this->defSndWpnEngine_ = nullptr;
     120            this->defSndWpnLaunch_ = nullptr;
    121121        }
    122122
  • code/branches/cpp11_v3/src/modules/weapons/projectiles/RocketOld.h

    r10622 r11054  
    6262            virtual ~RocketOld();
    6363
    64             virtual void tick(float dt); //!< Defines which actions the RocketOld has to take in each tick.
     64            virtual void tick(float dt) override; //!< Defines which actions the RocketOld has to take in each tick.
    6565
    66             virtual bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* cs, btManifoldPoint& contactPoint);
    67             virtual void destroyObject(void);
     66            virtual bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* cs, btManifoldPoint& contactPoint) override;
     67            virtual void destroyObject(void) override;
    6868            void destructionEffect();
    6969
    70             virtual void moveFrontBack(const Vector2& value) {}
    71             virtual void moveRightLeft(const Vector2& value) {}
    72             virtual void moveUpDown(const Vector2& value) {}
     70            virtual void moveFrontBack(const Vector2& value) override {}
     71            virtual void moveRightLeft(const Vector2& value) override {}
     72            virtual void moveUpDown(const Vector2& value) override {}
    7373
    74             virtual void rotateYaw(const Vector2& value);
    75             virtual void rotatePitch(const Vector2& value);
    76             virtual void rotateRoll(const Vector2& value);
     74            virtual void rotateYaw(const Vector2& value) override;
     75            virtual void rotatePitch(const Vector2& value) override;
     76            virtual void rotateRoll(const Vector2& value) override;
    7777
    7878            /**
     
    114114                { this->rotateRoll(Vector2(value, 0)); }
    115115
    116             virtual void setShooter(Pawn* shooter);
     116            virtual void setShooter(Pawn* shooter) override;
    117117
    118             virtual void fired(unsigned int firemode);
     118            virtual void fired(unsigned int firemode) override;
    119119
    120120        private:
  • code/branches/cpp11_v3/src/modules/weapons/projectiles/SimpleRocket.h

    r10216 r11054  
    6262            SimpleRocket(Context* context);
    6363            virtual ~SimpleRocket();
    64             virtual void tick(float dt);
     64            virtual void tick(float dt) override;
    6565
    66             virtual bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* cs, btManifoldPoint& contactPoint);
     66            virtual bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* cs, btManifoldPoint& contactPoint) override;
    6767
    6868            void disableFire(); //!< Method to disable the fire and stop all acceleration
    6969
    70             virtual void moveFrontBack(const Vector2& value){}
    71             virtual void moveRightLeft(const Vector2& value){}
    72             virtual void moveUpDown(const Vector2& value){}
     70            virtual void moveFrontBack(const Vector2& value) override{}
     71            virtual void moveRightLeft(const Vector2& value) override{}
     72            virtual void moveUpDown(const Vector2& value) override{}
    7373
    74             virtual void rotateYaw(const Vector2& value);
    75             virtual void rotatePitch(const Vector2& value);
    76             virtual void rotateRoll(const Vector2& value);
     74            virtual void rotateYaw(const Vector2& value) override;
     75            virtual void rotatePitch(const Vector2& value) override;
     76            virtual void rotateRoll(const Vector2& value) override;
    7777            void setDestroy();
    7878
     
    115115                { this->rotateRoll(Vector2(value, 0)); }
    116116
    117             virtual void setShooter(Pawn* shooter);
     117            virtual void setShooter(Pawn* shooter) override;
    118118
    119119            inline bool hasFuel() const
  • code/branches/cpp11_v3/src/modules/weapons/weaponmodes/EnergyDrink.h

    r9667 r11054  
    5757            virtual ~EnergyDrink() {}
    5858
    59             virtual void fire();
    60             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
     59            virtual void fire() override;
     60            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
    6161
    6262        private:
  • code/branches/cpp11_v3/src/modules/weapons/weaponmodes/FusionFire.h

    r9667 r11054  
    5454            virtual ~FusionFire() {}
    5555
    56             virtual void fire();
     56            virtual void fire() override;
    5757
    5858        private:
  • code/branches/cpp11_v3/src/modules/weapons/weaponmodes/GravityBombFire.h

    r10622 r11054  
    3434            virtual ~GravityBombFire();
    3535
    36             virtual void fire();
     36            virtual void fire() override;
    3737
    3838        private:
  • code/branches/cpp11_v3/src/modules/weapons/weaponmodes/HsW01.h

    r9945 r11054  
    5656            virtual ~HsW01();
    5757
    58             virtual void fire();
    59             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
     58            virtual void fire() override;
     59            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
    6060
    6161        protected:
  • code/branches/cpp11_v3/src/modules/weapons/weaponmodes/IceGun.h

    r11052 r11054  
    5454            virtual ~IceGun();
    5555
    56             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    57             virtual void fire();
     56            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
     57            virtual void fire() override;
    5858           
    5959            inline void setFreezeTime(float freezeTime)
  • code/branches/cpp11_v3/src/modules/weapons/weaponmodes/LaserFire.h

    r9667 r11054  
    5454            virtual ~LaserFire() {}
    5555
    56             virtual void fire();
     56            virtual void fire() override;
    5757
    5858        private:
  • code/branches/cpp11_v3/src/modules/weapons/weaponmodes/LightningGun.h

    r9667 r11054  
    5454            virtual ~LightningGun();
    5555
    56             virtual void fire();
     56            virtual void fire() override;
    5757
    5858       private:
  • code/branches/cpp11_v3/src/modules/weapons/weaponmodes/RocketFire.h

    r11052 r11054  
    5454            virtual ~RocketFire();
    5555
    56             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
     56            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
    5757
    58             virtual void fire();
     58            virtual void fire() override;
    5959            inline void setFuel(float fuel)
    6060                { this->fuel_ = fuel; }
  • code/branches/cpp11_v3/src/modules/weapons/weaponmodes/RocketFireOld.h

    r10622 r11054  
    5454            virtual ~RocketFireOld();
    5555
    56             virtual void fire();
     56            virtual void fire() override;
    5757
    5858        private:
  • code/branches/cpp11_v3/src/modules/weapons/weaponmodes/SimpleRocketFire.h

    r9667 r11054  
    5353            virtual ~SimpleRocketFire();
    5454            void deactivateFire();
    55             virtual void fire();
     55            virtual void fire() override;
    5656
    5757        private:
  • code/branches/cpp11_v3/src/modules/weapons/weaponmodes/SplitGun.h

    r11052 r11054  
    5454            virtual ~SplitGun();
    5555
    56             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    57             virtual void fire();
     56            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
     57            virtual void fire() override;
    5858
    5959            inline void setNumberOfSplits(int numberOfSplits)
Note: See TracChangeset for help on using the changeset viewer.