Changeset 11054 for code/branches/cpp11_v3/src/modules/weapons
- Timestamp:
- Jan 10, 2016, 1:54:11 PM (9 years ago)
- Location:
- code/branches/cpp11_v3
- Files:
-
- 33 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/cpp11_v3
- Property svn:mergeinfo changed
-
code/branches/cpp11_v3/src/modules/weapons/IceGunFreezer.cc
r11052 r11054 101 101 102 102 // 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))) 104 104 { 105 105 freezedSpaceShip_ = orxonox_cast<SpaceShip*>(parent); … … 118 118 void IceGunFreezer::stopFreezing() 119 119 { 120 if (freezedSpaceShip_ != NULL&& freezeFactor_ != 0.0)120 if (freezedSpaceShip_ != nullptr && freezeFactor_ != 0.0) 121 121 { 122 122 freezedSpaceShip_->addSpeedFactor(1/freezeFactor_); -
code/branches/cpp11_v3/src/modules/weapons/IceGunFreezer.h
r11052 r11054 55 55 IceGunFreezer(Context* context); 56 56 virtual ~IceGunFreezer(); 57 virtual void tick(float dt) ;57 virtual void tick(float dt) override; 58 58 virtual void startFreezing(); 59 59 virtual void stopFreezing(); -
code/branches/cpp11_v3/src/modules/weapons/RocketController.cc
r10258 r11054 38 38 #include "projectiles/SimpleRocket.h" 39 39 #include "weaponmodes/SimpleRocketFire.h" 40 #include "core/CoreIncludes.h" 40 41 41 42 namespace orxonox -
code/branches/cpp11_v3/src/modules/weapons/RocketController.h
r9667 r11054 55 55 virtual ~RocketController(); 56 56 57 virtual void tick(float dt) ;57 virtual void tick(float dt) override; 58 58 /** 59 59 @brief Get the rocket that is controlled by this controller. -
code/branches/cpp11_v3/src/modules/weapons/projectiles/BasicProjectile.cc
r11052 r11054 88 88 // The projectile is destroyed by its tick()-function (in the following tick). 89 89 90 Pawn* victim = orxonox_cast<Pawn*>(otherObject); // If otherObject isn't a Pawn, then victim is NULL90 Pawn* victim = orxonox_cast<Pawn*>(otherObject); // If otherObject isn't a Pawn, then victim is nullptr 91 91 92 92 WorldEntity* entity = orxonox_cast<WorldEntity*>(this); … … 146 146 bool BasicProjectile::isObjectRelatedToShooter(WorldEntity* otherObject) 147 147 { 148 for (WorldEntity* shooter = this->getShooter(); shooter != NULL; shooter = shooter->getParent())148 for (WorldEntity* shooter = this->getShooter(); shooter != nullptr; shooter = shooter->getParent()) 149 149 if (otherObject == shooter) 150 150 return true; 151 for (WorldEntity* object = otherObject; object != NULL; object = object->getParent())151 for (WorldEntity* object = otherObject; object != nullptr; object = object->getParent()) 152 152 if (otherObject == this->getShooter()) 153 153 return true; -
code/branches/cpp11_v3/src/modules/weapons/projectiles/BillboardProjectile.h
r10629 r11054 61 61 virtual void setMaterial(const std::string& material); 62 62 virtual const std::string& getMaterial(); 63 virtual void changedVisibility() ;63 virtual void changedVisibility() override; 64 64 65 65 private: -
code/branches/cpp11_v3/src/modules/weapons/projectiles/GravityBomb.h
r10622 r11054 41 41 GravityBomb(Context* context); 42 42 virtual ~GravityBomb(); 43 virtual void tick(float dt) ;43 virtual void tick(float dt) override; 44 44 45 virtual bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* cs, btManifoldPoint& contactPoint) ;45 virtual bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* cs, btManifoldPoint& contactPoint) override; 46 46 void detonate(); 47 47 private: -
code/branches/cpp11_v3/src/modules/weapons/projectiles/GravityBombField.cc
r11052 r11054 125 125 126 126 //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>()) 128 128 { 129 Vector3 distanceVector = it->getWorldPosition()-this->getWorldPosition();129 Vector3 distanceVector = pawn->getWorldPosition()-this->getWorldPosition(); 130 130 //orxout(debug_output) << "Found Pawn:" << it->getWorldPosition() << endl; 131 131 if(distanceVector.length()< forceSphereRadius_) 132 132 { 133 133 //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()) 135 135 { 136 136 //orxout(debug_output) << "Found Pawn to damage: " << it->getWorldPosition() << endl; 137 137 float damage = FORCE_FIELD_EXPLOSION_DAMMAGE*(1-distanceVector.length()/EXPLOSION_RADIUS); 138 138 //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); 141 141 } 142 142 } -
code/branches/cpp11_v3/src/modules/weapons/projectiles/GravityBombField.h
r10622 r11054 39 39 GravityBombField(Context* context); 40 40 virtual ~GravityBombField(); 41 virtual void tick(float dt) ;41 virtual void tick(float dt) override; 42 42 virtual void destroy(); 43 43 -
code/branches/cpp11_v3/src/modules/weapons/projectiles/IceGunProjectile.h
r11052 r11054 62 62 63 63 protected: 64 virtual bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* cs, btManifoldPoint& contactPoint) ;64 virtual bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* cs, btManifoldPoint& contactPoint) override; 65 65 static const float particleDestructionDelay_; 66 66 private: -
code/branches/cpp11_v3/src/modules/weapons/projectiles/LightningGunProjectile.h
r9667 r11054 58 58 virtual ~LightningGunProjectile() {} 59 59 60 virtual void setMaterial(const std::string& material) ;60 virtual void setMaterial(const std::string& material) override; 61 61 62 62 private: -
code/branches/cpp11_v3/src/modules/weapons/projectiles/MineProjectile.cc
r11052 r11054 217 217 { 218 218 // 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) 220 220 { 221 221 Vector3 distanceVector = it->getWorldPosition()-this->getWorldPosition(); -
code/branches/cpp11_v3/src/modules/weapons/projectiles/ParticleProjectile.cc
r10624 r11054 58 58 } 59 59 else 60 this->particles_ = 0;60 this->particles_ = nullptr; 61 61 } 62 62 -
code/branches/cpp11_v3/src/modules/weapons/projectiles/ParticleProjectile.h
r9667 r11054 53 53 ParticleProjectile(Context* context); 54 54 virtual ~ParticleProjectile(); 55 virtual void changedVisibility() ;55 virtual void changedVisibility() override; 56 56 57 57 private: -
code/branches/cpp11_v3/src/modules/weapons/projectiles/Projectile.cc
r10629 r11054 94 94 void Projectile::setCollisionShapeRadius(float radius) 95 95 { 96 if (collisionShape_ != NULL&& radius > 0)96 if (collisionShape_ != nullptr && radius > 0) 97 97 { 98 98 collisionShape_->setRadius(radius); -
code/branches/cpp11_v3/src/modules/weapons/projectiles/Projectile.h
r11052 r11054 64 64 void setConfigValues(); 65 65 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; 68 68 69 69 protected: -
code/branches/cpp11_v3/src/modules/weapons/projectiles/Rocket.cc
r11052 r11054 117 117 else 118 118 { 119 this->defSndWpnEngine_ = 0;120 this->defSndWpnLaunch_ = 0;119 this->defSndWpnEngine_ = nullptr; 120 this->defSndWpnLaunch_ = nullptr; 121 121 } 122 122 -
code/branches/cpp11_v3/src/modules/weapons/projectiles/Rocket.h
r11052 r11054 62 62 virtual ~Rocket(); 63 63 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. 65 65 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; 68 68 void destructionEffect(); 69 69 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 {} 73 73 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; 77 77 78 78 /** … … 114 114 { this->rotateRoll(Vector2(value, 0)); } 115 115 116 virtual void setShooter(Pawn* shooter) ;116 virtual void setShooter(Pawn* shooter) override; 117 117 118 virtual void fired(unsigned int firemode) ;118 virtual void fired(unsigned int firemode) override; 119 119 120 120 /** -
code/branches/cpp11_v3/src/modules/weapons/projectiles/RocketOld.cc
r10622 r11054 117 117 else 118 118 { 119 this->defSndWpnEngine_ = 0;120 this->defSndWpnLaunch_ = 0;119 this->defSndWpnEngine_ = nullptr; 120 this->defSndWpnLaunch_ = nullptr; 121 121 } 122 122 -
code/branches/cpp11_v3/src/modules/weapons/projectiles/RocketOld.h
r10622 r11054 62 62 virtual ~RocketOld(); 63 63 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. 65 65 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; 68 68 void destructionEffect(); 69 69 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 {} 73 73 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; 77 77 78 78 /** … … 114 114 { this->rotateRoll(Vector2(value, 0)); } 115 115 116 virtual void setShooter(Pawn* shooter) ;116 virtual void setShooter(Pawn* shooter) override; 117 117 118 virtual void fired(unsigned int firemode) ;118 virtual void fired(unsigned int firemode) override; 119 119 120 120 private: -
code/branches/cpp11_v3/src/modules/weapons/projectiles/SimpleRocket.h
r10216 r11054 62 62 SimpleRocket(Context* context); 63 63 virtual ~SimpleRocket(); 64 virtual void tick(float dt) ;64 virtual void tick(float dt) override; 65 65 66 virtual bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* cs, btManifoldPoint& contactPoint) ;66 virtual bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* cs, btManifoldPoint& contactPoint) override; 67 67 68 68 void disableFire(); //!< Method to disable the fire and stop all acceleration 69 69 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{} 73 73 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; 77 77 void setDestroy(); 78 78 … … 115 115 { this->rotateRoll(Vector2(value, 0)); } 116 116 117 virtual void setShooter(Pawn* shooter) ;117 virtual void setShooter(Pawn* shooter) override; 118 118 119 119 inline bool hasFuel() const -
code/branches/cpp11_v3/src/modules/weapons/weaponmodes/EnergyDrink.h
r9667 r11054 57 57 virtual ~EnergyDrink() {} 58 58 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; 61 61 62 62 private: -
code/branches/cpp11_v3/src/modules/weapons/weaponmodes/FusionFire.h
r9667 r11054 54 54 virtual ~FusionFire() {} 55 55 56 virtual void fire() ;56 virtual void fire() override; 57 57 58 58 private: -
code/branches/cpp11_v3/src/modules/weapons/weaponmodes/GravityBombFire.h
r10622 r11054 34 34 virtual ~GravityBombFire(); 35 35 36 virtual void fire() ;36 virtual void fire() override; 37 37 38 38 private: -
code/branches/cpp11_v3/src/modules/weapons/weaponmodes/HsW01.h
r9945 r11054 56 56 virtual ~HsW01(); 57 57 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; 60 60 61 61 protected: -
code/branches/cpp11_v3/src/modules/weapons/weaponmodes/IceGun.h
r11052 r11054 54 54 virtual ~IceGun(); 55 55 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; 58 58 59 59 inline void setFreezeTime(float freezeTime) -
code/branches/cpp11_v3/src/modules/weapons/weaponmodes/LaserFire.h
r9667 r11054 54 54 virtual ~LaserFire() {} 55 55 56 virtual void fire() ;56 virtual void fire() override; 57 57 58 58 private: -
code/branches/cpp11_v3/src/modules/weapons/weaponmodes/LightningGun.h
r9667 r11054 54 54 virtual ~LightningGun(); 55 55 56 virtual void fire() ;56 virtual void fire() override; 57 57 58 58 private: -
code/branches/cpp11_v3/src/modules/weapons/weaponmodes/RocketFire.h
r11052 r11054 54 54 virtual ~RocketFire(); 55 55 56 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) ;56 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; 57 57 58 virtual void fire() ;58 virtual void fire() override; 59 59 inline void setFuel(float fuel) 60 60 { this->fuel_ = fuel; } -
code/branches/cpp11_v3/src/modules/weapons/weaponmodes/RocketFireOld.h
r10622 r11054 54 54 virtual ~RocketFireOld(); 55 55 56 virtual void fire() ;56 virtual void fire() override; 57 57 58 58 private: -
code/branches/cpp11_v3/src/modules/weapons/weaponmodes/SimpleRocketFire.h
r9667 r11054 53 53 virtual ~SimpleRocketFire(); 54 54 void deactivateFire(); 55 virtual void fire() ;55 virtual void fire() override; 56 56 57 57 private: -
code/branches/cpp11_v3/src/modules/weapons/weaponmodes/SplitGun.h
r11052 r11054 54 54 virtual ~SplitGun(); 55 55 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; 58 58 59 59 inline void setNumberOfSplits(int numberOfSplits)
Note: See TracChangeset
for help on using the changeset viewer.