Changeset 11054 for code/branches/cpp11_v3/src/modules/jump
- Timestamp:
- Jan 10, 2016, 1:54:11 PM (9 years ago)
- Location:
- code/branches/cpp11_v3
- Files:
-
- 39 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/cpp11_v3
- Property svn:mergeinfo changed
-
code/branches/cpp11_v3/src/modules/jump/Jump.cc
r10262 r11054 34 34 #include "Jump.h" 35 35 #include "core/CoreIncludes.h" 36 #include "core/EventIncludes.h" 37 #include "core/command/Executor.h" 38 #include "core/config/ConfigValueIncludes.h" 39 #include "gamestates/GSLevel.h" 40 #include "chat/ChatManager.h" 36 41 37 #include "JumpCenterpoint.h" 42 38 #include "JumpPlatform.h" … … 56 52 #include "JumpBoots.h" 57 53 #include "JumpShield.h" 54 55 #include "gamestates/GSLevel.h" 58 56 #include "infos/PlayerInfo.h" 57 #include "graphics/Camera.h" 59 58 60 59 namespace orxonox … … 66 65 RegisterObject(Jump); 67 66 68 center_ = 0;69 figure_ = 0;70 camera = 0;67 center_ = nullptr; 68 figure_ = nullptr; 69 camera = nullptr; 71 70 setHUDTemplate("JumpHUD"); 72 73 setConfigValues();74 71 } 75 72 … … 86 83 SUPER(Jump, tick, dt); 87 84 88 if (figure_ != NULL)85 if (figure_ != nullptr) 89 86 { 90 87 Vector3 figurePosition = figure_->getPosition(); … … 101 98 if (screenShiftSinceLastUpdate_ > center_->getSectionLength()) 102 99 { 103 if (sectionNumber_ > 2 && sectionNumber_%4 == 0 && rand()%2 == 0 && figure_->propellerActive_ == false && figure_->rocketActive_ == false&& addAdventure(adventureNumber_) == true)100 if (sectionNumber_ > 2 && sectionNumber_%4 == 0 && rand()%2 == 0 && figure_->propellerActive_ == nullptr && figure_->rocketActive_ == nullptr && addAdventure(adventureNumber_) == true) 104 101 { 105 102 screenShiftSinceLastUpdate_ -= 2*center_->getSectionLength(); … … 133 130 134 131 135 if (camera != NULL)132 if (camera != nullptr) 136 133 { 137 134 Vector3 cameraPosition = Vector3(0, totalScreenShift_, 0); … … 144 141 } 145 142 146 ObjectList<JumpPlatform>::iterator beginPlatform = ObjectList<JumpPlatform>::begin(); 147 ObjectList<JumpPlatform>::iterator endPlatform = ObjectList<JumpPlatform>::end(); 148 ObjectList<JumpPlatform>::iterator itPlatform = beginPlatform; 143 ObjectList<JumpPlatform> listPlatform; 144 ObjectList<JumpPlatform>::iterator itPlatform = listPlatform.begin(); 149 145 Vector3 platformPosition; 150 146 151 while (itPlatform != endPlatform)147 while (itPlatform != listPlatform.end()) 152 148 { 153 149 platformPosition = itPlatform->getPosition(); … … 166 162 167 163 // Deleted deactivated platforms 168 ObjectList<JumpPlatformDisappear>::iterator beginDisappear = ObjectList<JumpPlatformDisappear>::begin(); 169 ObjectList<JumpPlatformDisappear>::iterator endDisappear = ObjectList<JumpPlatformDisappear>::end(); 170 ObjectList<JumpPlatformDisappear>::iterator itDisappear = beginDisappear; 171 172 while (itDisappear != endDisappear) 164 ObjectList<JumpPlatformDisappear> listDisappear; 165 ObjectList<JumpPlatformDisappear>::iterator itDisappear = listDisappear.begin(); 166 167 while (itDisappear != listDisappear.end()) 173 168 { 174 169 if (!itDisappear->isActive()) … … 185 180 } 186 181 187 ObjectList<JumpPlatformTimer>::iterator beginTimer = ObjectList<JumpPlatformTimer>::begin(); 188 ObjectList<JumpPlatformTimer>::iterator endTimer = ObjectList<JumpPlatformTimer>::end(); 189 ObjectList<JumpPlatformTimer>::iterator itTimer = beginTimer; 190 191 while (itTimer != endTimer) 182 ObjectList<JumpPlatformTimer> listTimer; 183 ObjectList<JumpPlatformTimer>::iterator itTimer = listTimer.begin(); 184 185 while (itTimer != listTimer.end()) 192 186 { 193 187 if (!itTimer->isActive()) … … 204 198 } 205 199 206 ObjectList<JumpProjectile>::iterator beginProjectile = ObjectList<JumpProjectile>::begin(); 207 ObjectList<JumpProjectile>::iterator endProjectile = ObjectList<JumpProjectile>::end(); 208 ObjectList<JumpProjectile>::iterator itProjectile = beginProjectile; 200 ObjectList<JumpProjectile> listProjectile; 201 ObjectList<JumpProjectile>::iterator itProjectile = listProjectile.begin(); 209 202 Vector3 projectilePosition; 210 203 211 while (itProjectile != endProjectile)204 while (itProjectile != listProjectile.end()) 212 205 { 213 206 projectilePosition = itProjectile->getPosition(); … … 225 218 } 226 219 227 ObjectList<JumpEnemy>::iterator beginEnemy = ObjectList<JumpEnemy>::begin(); 228 ObjectList<JumpEnemy>::iterator endEnemy = ObjectList<JumpEnemy>::end(); 229 ObjectList<JumpEnemy>::iterator itEnemy = beginEnemy; 220 ObjectList<JumpEnemy> listEnemy; 221 ObjectList<JumpEnemy>::iterator itEnemy = listEnemy.begin(); 230 222 Vector3 enemyPosition; 231 223 232 while (itEnemy != endEnemy)224 while (itEnemy != listEnemy.end()) 233 225 { 234 226 enemyPosition = itEnemy->getPosition(); … … 246 238 } 247 239 248 ObjectList<JumpItem>::iterator beginItem = ObjectList<JumpItem>::begin(); 249 ObjectList<JumpItem>::iterator endItem = ObjectList<JumpItem>::end(); 250 ObjectList<JumpItem>::iterator itItem = beginItem; 240 ObjectList<JumpItem> listItem; 241 ObjectList<JumpItem>::iterator itItem = listItem.begin(); 251 242 Vector3 itemPosition; 252 243 253 while (itItem != endItem)244 while (itItem != listItem.end()) 254 245 { 255 246 itemPosition = itItem->getPosition(); … … 273 264 void Jump::cleanup() 274 265 { 275 camera = 0;266 camera = nullptr; 276 267 } 277 268 278 269 void Jump::start() 279 270 { 280 if (center_ != NULL) // There needs to be a JumpCenterpoint, i.e. the area the game takes place.281 { 282 if (figure_ == NULL)271 if (center_ != nullptr) // There needs to be a JumpCenterpoint, i.e. the area the game takes place. 272 { 273 if (figure_ == nullptr) 283 274 { 284 275 figure_ = new JumpFigure(center_->getContext()); … … 301 292 Deathmatch::start(); 302 293 303 if (figure_ != NULL)294 if (figure_ != nullptr) 304 295 { 305 296 camera = figure_->getCamera(); … … 328 319 assert(player); 329 320 330 if (figure_->getPlayer() == NULL)321 if (figure_->getPlayer() == nullptr) 331 322 { 332 323 player->startControl(figure_); … … 337 328 PlayerInfo* Jump::getPlayer() const 338 329 { 339 if (this->figure_ != NULL)330 if (this->figure_ != nullptr) 340 331 { 341 332 return this->figure_->getPlayer(); … … 343 334 else 344 335 { 345 return 0;336 return nullptr; 346 337 } 347 338 } … … 349 340 void Jump::addPlatform(JumpPlatform* newPlatform, std::string platformTemplate, float xPosition, float zPosition) 350 341 { 351 if (newPlatform != NULL && center_ != NULL)342 if (newPlatform != nullptr && center_ != nullptr) 352 343 { 353 344 newPlatform->addTemplate(platformTemplate); … … 417 408 { 418 409 JumpProjectile* newProjectile = new JumpProjectile(center_->getContext()); 419 if (newProjectile != NULL && center_ != NULL)410 if (newProjectile != nullptr && center_ != nullptr) 420 411 { 421 412 newProjectile->addTemplate(center_->getProjectileTemplate()); … … 430 421 { 431 422 JumpSpring* newSpring = new JumpSpring(center_->getContext()); 432 if (newSpring != NULL && center_ != NULL)423 if (newSpring != nullptr && center_ != nullptr) 433 424 { 434 425 newSpring->addTemplate(center_->getSpringTemplate()); … … 443 434 { 444 435 JumpSpring* newSpring = new JumpSpring(center_->getContext()); 445 if (newSpring != NULL && center_ != NULL)436 if (newSpring != nullptr && center_ != nullptr) 446 437 { 447 438 newSpring->addTemplate(center_->getSpringTemplate()); … … 456 447 { 457 448 JumpRocket* newRocket = new JumpRocket(center_->getContext()); 458 if (newRocket != NULL && center_ != NULL)449 if (newRocket != nullptr && center_ != nullptr) 459 450 { 460 451 newRocket->addTemplate(center_->getRocketTemplate()); … … 469 460 { 470 461 JumpRocket* newRocket = new JumpRocket(center_->getContext()); 471 if (newRocket != NULL && center_ != NULL)462 if (newRocket != nullptr && center_ != nullptr) 472 463 { 473 464 newRocket->addTemplate(center_->getRocketTemplate()); … … 482 473 { 483 474 JumpPropeller* newPropeller = new JumpPropeller(center_->getContext()); 484 if (newPropeller != NULL && center_ != NULL)475 if (newPropeller != nullptr && center_ != nullptr) 485 476 { 486 477 newPropeller->addTemplate(center_->getPropellerTemplate()); … … 495 486 { 496 487 JumpPropeller* newPropeller = new JumpPropeller(center_->getContext()); 497 if (newPropeller != NULL && center_ != NULL)488 if (newPropeller != nullptr && center_ != nullptr) 498 489 { 499 490 newPropeller->addTemplate(center_->getPropellerTemplate()); … … 508 499 { 509 500 JumpBoots* newBoots = new JumpBoots(center_->getContext()); 510 if (newBoots != NULL && center_ != NULL)501 if (newBoots != nullptr && center_ != nullptr) 511 502 { 512 503 newBoots->addTemplate(center_->getBootsTemplate()); … … 521 512 { 522 513 JumpBoots* newBoots = new JumpBoots(center_->getContext()); 523 if (newBoots != NULL && center_ != NULL)514 if (newBoots != nullptr && center_ != nullptr) 524 515 { 525 516 newBoots->addTemplate(center_->getBootsTemplate()); … … 534 525 { 535 526 JumpShield* newShield = new JumpShield(center_->getContext()); 536 if (newShield != NULL && center_ != NULL)527 if (newShield != nullptr && center_ != nullptr) 537 528 { 538 529 newShield->addTemplate(center_->getShieldTemplate()); … … 547 538 { 548 539 JumpShield* newShield = new JumpShield(center_->getContext()); 549 if (newShield != NULL && center_ != NULL)540 if (newShield != nullptr && center_ != nullptr) 550 541 { 551 542 newShield->addTemplate(center_->getShieldTemplate()); … … 560 551 { 561 552 JumpEnemy* newEnemy = new JumpEnemy(center_->getContext()); 562 if (newEnemy != NULL && center_ != NULL)553 if (newEnemy != nullptr && center_ != nullptr) 563 554 { 564 555 switch (type) … … 1273 1264 float Jump::getFuel() const 1274 1265 { 1275 if (this->figure_ != NULL)1276 { 1277 if (this->figure_->rocketActive_ != NULL)1266 if (this->figure_ != nullptr) 1267 { 1268 if (this->figure_->rocketActive_ != nullptr) 1278 1269 { 1279 1270 return this->figure_->rocketActive_->getFuelState(); 1280 1271 } 1281 else if (this->figure_->propellerActive_ != NULL)1272 else if (this->figure_->propellerActive_ != nullptr) 1282 1273 { 1283 1274 return this->figure_->propellerActive_->getFuelState(); 1284 1275 } 1285 else if (this->figure_->shieldActive_ != NULL)1276 else if (this->figure_->shieldActive_ != nullptr) 1286 1277 { 1287 1278 return this->figure_->shieldActive_->getFuelState(); 1288 1279 } 1289 else if (this->figure_->bootsActive_ != NULL)1280 else if (this->figure_->bootsActive_ != nullptr) 1290 1281 { 1291 1282 return this->figure_->bootsActive_->getFuelState(); … … 1300 1291 return figure_->dead_; 1301 1292 } 1293 1294 void Jump::setCenterpoint(JumpCenterpoint* center) 1295 { 1296 center_ = center; 1297 } 1298 1302 1299 } -
code/branches/cpp11_v3/src/modules/jump/Jump.h
r10262 r11054 31 31 32 32 #include "jump/JumpPrereqs.h" 33 #include "tools/Timer.h"34 #include "graphics/Camera.h"35 33 #include "gametypes/Deathmatch.h" 36 #include "JumpCenterpoint.h"37 #include <list>38 34 39 35 namespace orxonox … … 44 40 Jump(Context* context); 45 41 virtual ~Jump(); 46 virtual void tick(float dt) ;47 virtual void start() ;48 virtual void end() ;49 virtual void spawnPlayer(PlayerInfo* player) ;42 virtual void tick(float dt) override; 43 virtual void start() override; 44 virtual void end() override; 45 virtual void spawnPlayer(PlayerInfo* player) override; 50 46 int getScore(PlayerInfo* player) const; 51 47 float getFuel() const; 52 48 bool getDead(PlayerInfo* player) const; 53 void setCenterpoint(JumpCenterpoint* center) 54 { center_ = center; } 49 void setCenterpoint(JumpCenterpoint* center); 55 50 PlayerInfo* getPlayer() const; 56 51 -
code/branches/cpp11_v3/src/modules/jump/JumpBoots.cc
r10262 r11054 35 35 36 36 #include "core/CoreIncludes.h" 37 #include "core/GameMode.h" 38 #include "graphics/Model.h" 39 #include "gametypes/Gametype.h" 40 37 #include "core/XMLPort.h" 41 38 #include "JumpFigure.h" 42 43 #include "sound/WorldSound.h"44 #include "core/XMLPort.h"45 39 46 40 namespace orxonox … … 78 72 Vector3 rocketPosition = getWorldPosition(); 79 73 80 if (attachedToFigure_ == false && figure_ != NULL)74 if (attachedToFigure_ == false && figure_ != nullptr) 81 75 { 82 76 Vector3 figurePosition = figure_->getWorldPosition(); -
code/branches/cpp11_v3/src/modules/jump/JumpBoots.h
r10262 r11054 30 30 #define _JumpBoots_H__ 31 31 32 #include "jump/JumpPrereqs.h" 33 #include "util/Math.h" 34 #include "worldentities/MovableEntity.h" 35 32 #include "JumpPrereqs.h" 33 #include "JumpItem.h" 36 34 37 35 namespace orxonox … … 42 40 JumpBoots(Context* context); 43 41 virtual ~JumpBoots(); 44 virtual void tick(float dt) ;45 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) ;46 virtual void touchFigure() ;42 virtual void tick(float dt) override; 43 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; 44 virtual void touchFigure() override; 47 45 virtual float getFuelState(); 48 46 protected: -
code/branches/cpp11_v3/src/modules/jump/JumpCenterpoint.cc
r10624 r11054 33 33 34 34 #include "JumpCenterpoint.h" 35 35 36 #include "core/CoreIncludes.h" 36 37 #include "core/XMLPort.h" … … 82 83 void JumpCenterpoint::checkGametype() 83 84 { 84 if (getGametype() != NULL&& this->getGametype()->isA(Class(Jump)))85 if (getGametype() != nullptr && this->getGametype()->isA(Class(Jump))) 85 86 { 86 87 Jump* jumpGametype = orxonox_cast<Jump*>(this->getGametype()); -
code/branches/cpp11_v3/src/modules/jump/JumpCenterpoint.h
r10624 r11054 31 31 32 32 #include "jump/JumpPrereqs.h" 33 34 #include <string>35 36 #include <util/Math.h>37 38 33 #include "worldentities/StaticEntity.h" 39 34 … … 113 108 JumpCenterpoint(Context* context); //!< Constructor. Registers and initializes the object and checks whether the gametype is actually Jump. 114 109 virtual ~JumpCenterpoint() {} 115 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) ; //!< Method to create a JumpCenterpoint through XML.110 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; //!< Method to create a JumpCenterpoint through XML. 116 111 void setPlatformStaticTemplate(const std::string& balltemplate) 117 112 { this->platformStaticTemplate_ = balltemplate; } -
code/branches/cpp11_v3/src/modules/jump/JumpEnemy.cc
r10624 r11054 35 35 36 36 #include "core/CoreIncludes.h" 37 #include "core/GameMode.h" 38 #include "graphics/Model.h" 39 #include "gametypes/Gametype.h" 40 37 #include "core/XMLPort.h" 41 38 #include "JumpFigure.h" 42 43 #include "sound/WorldSound.h"44 #include "core/XMLPort.h"45 39 46 40 namespace orxonox … … 57 51 58 52 dead_ = false; 59 figure_ = 0;53 figure_ = nullptr; 60 54 width_ = 0.0; 61 55 height_ = 0.0; … … 125 119 Vector3 enemyPosition = getPosition(); 126 120 127 if (figure_ != NULL)121 if (figure_ != nullptr) 128 122 { 129 123 Vector3 figurePosition = figure_->getPosition(); -
code/branches/cpp11_v3/src/modules/jump/JumpEnemy.h
r10624 r11054 37 37 38 38 #include "jump/JumpPrereqs.h" 39 40 #include "util/Math.h"41 42 39 #include "worldentities/MovableEntity.h" 43 44 40 45 41 namespace orxonox … … 50 46 JumpEnemy(Context* context); 51 47 virtual ~JumpEnemy(); 52 virtual void tick(float dt) ;53 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) ;48 virtual void tick(float dt) override; 49 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; 54 50 void setFieldDimension(float width, float height) 55 51 { this->fieldWidth_ = width; this->fieldHeight_ = height; } -
code/branches/cpp11_v3/src/modules/jump/JumpFigure.cc
r10262 r11054 36 36 #include "core/CoreIncludes.h" 37 37 #include "core/XMLPort.h" 38 #include "graphics/Model.h" 39 #include "JumpRocket.h" 40 #include "JumpPropeller.h" 41 #include "JumpBoots.h" 42 #include "JumpShield.h" 38 43 39 44 namespace orxonox … … 46 51 47 52 // initialize variables 48 leftHand_ = NULL;49 rightHand_ = NULL;53 leftHand_ = nullptr; 54 rightHand_ = nullptr; 50 55 fieldHeight_ = 0; 51 56 fieldWidth_ = 0; … … 70 75 animateHands_ = false; 71 76 turnUp_ = false; 72 rocketActive_ = NULL;73 propellerActive_ = NULL;74 bootsActive_ = NULL;75 shieldActive_ = NULL;77 rocketActive_ = nullptr; 78 propellerActive_ = nullptr; 79 bootsActive_ = nullptr; 80 shieldActive_ = nullptr; 76 81 rocketSpeed_ = 0.0; 77 82 propellerSpeed_ = 0.0; … … 106 111 // Move up/down 107 112 Vector3 velocity = getVelocity(); 108 if (rocketActive_ != NULL)113 if (rocketActive_ != nullptr) 109 114 { 110 115 velocity.z = rocketSpeed_; 111 116 } 112 else if (propellerActive_ != NULL)117 else if (propellerActive_ != nullptr) 113 118 { 114 119 velocity.z = propellerSpeed_; … … 139 144 } 140 145 141 if (leftHand_ != NULL)146 if (leftHand_ != nullptr) 142 147 { 143 148 leftHand_->setOrientation(Vector3(0.0, 1.0, 0.0), Degree(-handAngle_)); 144 149 } 145 if (rightHand_ != NULL)150 if (rightHand_ != nullptr) 146 151 { 147 152 rightHand_->setOrientation(Vector3(0.0, 1.0, 0.0), Degree(handAngle_)); … … 207 212 { 208 213 Vector3 velocity = getVelocity(); 209 if (bootsActive_ == NULL)214 if (bootsActive_ == nullptr) 210 215 { 211 216 velocity.z = 1.2f*jumpSpeed_; … … 234 239 void JumpFigure::CollisionWithEnemy(JumpEnemy* enemy) 235 240 { 236 if (rocketActive_ == NULL && propellerActive_ == NULL && shieldActive_ == NULL)241 if (rocketActive_ == nullptr && propellerActive_ == nullptr && shieldActive_ == nullptr) 237 242 { 238 243 dead_ = true; … … 242 247 bool JumpFigure::StartRocket(JumpRocket* rocket) 243 248 { 244 if (rocketActive_ == NULL && propellerActive_ == NULL && bootsActive_ == NULL)249 if (rocketActive_ == nullptr && propellerActive_ == nullptr && bootsActive_ == nullptr) 245 250 { 246 251 attach(rocket); … … 261 266 detach(rocket); 262 267 rocket->destroy(); 263 rocketActive_ = NULL;268 rocketActive_ = nullptr; 264 269 } 265 270 266 271 bool JumpFigure::StartPropeller(JumpPropeller* propeller) 267 272 { 268 if (rocketActive_ == NULL && propellerActive_ == NULL && bootsActive_ == NULL)273 if (rocketActive_ == nullptr && propellerActive_ == nullptr && bootsActive_ == nullptr) 269 274 { 270 275 attach(propeller); … … 285 290 detach(propeller); 286 291 propeller->destroy(); 287 propellerActive_ = NULL;292 propellerActive_ = nullptr; 288 293 } 289 294 290 295 bool JumpFigure::StartBoots(JumpBoots* boots) 291 296 { 292 if (rocketActive_ == NULL && propellerActive_ == NULL && bootsActive_ == NULL)297 if (rocketActive_ == nullptr && propellerActive_ == nullptr && bootsActive_ == nullptr) 293 298 { 294 299 attach(boots); … … 309 314 detach(boots); 310 315 boots->destroy(); 311 bootsActive_ = NULL;316 bootsActive_ = nullptr; 312 317 } 313 318 314 319 bool JumpFigure::StartShield(JumpShield* shield) 315 320 { 316 if (shieldActive_ == false)321 if (shieldActive_ == nullptr) 317 322 { 318 323 attach(shield); … … 333 338 detach(shield); 334 339 shield->destroy(); 335 shieldActive_ = NULL;340 shieldActive_ = nullptr; 336 341 } 337 342 -
code/branches/cpp11_v3/src/modules/jump/JumpFigure.h
r10262 r11054 40 40 JumpFigure(Context* context); //!< Constructor. Registers and initializes the object. 41 41 virtual ~JumpFigure() {} 42 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) ;43 virtual void tick(float dt) ;44 virtual void moveFrontBack(const Vector2& value) ; //!< Overloaded the function to steer the bat up and down.45 virtual void moveRightLeft(const Vector2& value) ; //!< Overloaded the function to steer the bat up and down.46 virtual void rotateYaw(const Vector2& value) ;47 virtual void rotatePitch(const Vector2& value) ;48 virtual void rotateRoll(const Vector2& value) ;42 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; 43 virtual void tick(float dt) override; 44 virtual void moveFrontBack(const Vector2& value) override; //!< Overloaded the function to steer the bat up and down. 45 virtual void moveRightLeft(const Vector2& value) override; //!< Overloaded the function to steer the bat up and down. 46 virtual void rotateYaw(const Vector2& value) override; 47 virtual void rotatePitch(const Vector2& value) override; 48 virtual void rotateRoll(const Vector2& value) override; 49 49 void fire(unsigned int firemode); 50 virtual void fired(unsigned int firemode) ;50 virtual void fired(unsigned int firemode) override; 51 51 virtual void JumpFromPlatform(JumpPlatform* platform); 52 52 virtual void JumpFromSpring(JumpSpring* spring); -
code/branches/cpp11_v3/src/modules/jump/JumpItem.cc
r10624 r11054 35 35 36 36 #include "core/CoreIncludes.h" 37 #include "core/GameMode.h" 38 #include "graphics/Model.h" 39 #include "gametypes/Gametype.h" 40 37 #include "core/XMLPort.h" 41 38 #include "JumpFigure.h" 42 43 #include "sound/WorldSound.h"44 #include "core/XMLPort.h"45 39 46 40 namespace orxonox … … 54 48 attachedToFigure_ = false; 55 49 56 figure_ = 0;50 figure_ = nullptr; 57 51 height_ = 0.0; 58 52 width_ = 0.0; -
code/branches/cpp11_v3/src/modules/jump/JumpItem.h
r10624 r11054 37 37 38 38 #include "jump/JumpPrereqs.h" 39 40 #include "util/Math.h"41 42 39 #include "worldentities/MovableEntity.h" 43 40 … … 50 47 JumpItem(Context* context); 51 48 virtual ~JumpItem(); 52 virtual void tick(float dt) ;53 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) ;49 virtual void tick(float dt) override; 50 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; 54 51 virtual void setProperties(float newLeftBoundary, float newRightBoundary, float newLowerBoundary, float newUpperBoundary, float newHSpeed, float newVSpeed); 55 52 virtual void setFigure(JumpFigure* newFigure); -
code/branches/cpp11_v3/src/modules/jump/JumpPlatform.cc
r10632 r11054 36 36 #include "core/CoreIncludes.h" 37 37 #include "core/GameMode.h" 38 #include "graphics/Model.h" 39 #include "gametypes/Gametype.h" 40 38 #include "core/XMLPort.h" 39 #include "sound/WorldSound.h" 41 40 #include "JumpFigure.h" 42 43 #include "sound/WorldSound.h"44 #include "core/XMLPort.h"45 41 46 42 namespace orxonox … … 52 48 RegisterObject(JumpPlatform); 53 49 54 figure_ = 0;50 figure_ = nullptr; 55 51 56 52 setPosition(Vector3(0,0,0)); … … 90 86 Vector3 platformPosition = this->getPosition(); 91 87 92 if (figure_ != NULL)88 if (figure_ != nullptr) 93 89 { 94 90 Vector3 figurePosition = figure_->getPosition(); -
code/branches/cpp11_v3/src/modules/jump/JumpPlatform.h
r10632 r11054 36 36 #define _JumpPlatform_H__ 37 37 38 #include "jump/JumpPrereqs.h" 39 #include "util/Math.h" 38 #include "JumpPrereqs.h" 40 39 #include "worldentities/MovableEntity.h" 41 40 … … 47 46 JumpPlatform(Context* context); 48 47 virtual ~JumpPlatform(); 49 virtual void tick(float dt) ;50 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) ;48 virtual void tick(float dt) override; 49 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; 51 50 void setFigure(JumpFigure* newFigure); 52 51 virtual void touchFigure(); -
code/branches/cpp11_v3/src/modules/jump/JumpPlatformDisappear.cc
r10262 r11054 35 35 36 36 #include "core/CoreIncludes.h" 37 #include "core/GameMode.h" 38 39 #include "gametypes/Gametype.h" 40 37 #include "core/XMLPort.h" 41 38 #include "JumpFigure.h" 42 43 #include "sound/WorldSound.h"44 #include "core/XMLPort.h"45 39 46 40 namespace orxonox -
code/branches/cpp11_v3/src/modules/jump/JumpPlatformDisappear.h
r10262 r11054 36 36 #define _JumpPlatformDisappear_H__ 37 37 38 #include "jump/JumpPrereqs.h" 39 #include "util/Math.h" 40 #include "worldentities/MovableEntity.h" 38 #include "JumpPrereqs.h" 39 #include "JumpPlatform.h" 41 40 42 41 namespace orxonox … … 47 46 JumpPlatformDisappear(Context* context); 48 47 virtual ~JumpPlatformDisappear(); 49 virtual void tick(float dt) ;50 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) ;48 virtual void tick(float dt) override; 49 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; 51 50 virtual void setProperties(bool active); 52 51 virtual bool isActive(); 53 virtual void touchFigure() ;52 virtual void touchFigure() override; 54 53 55 54 protected: -
code/branches/cpp11_v3/src/modules/jump/JumpPlatformFake.cc
r10262 r11054 33 33 34 34 #include "JumpPlatformFake.h" 35 35 36 #include "core/CoreIncludes.h" 36 #include "core/GameMode.h"37 #include "gametypes/Gametype.h"38 #include "JumpFigure.h"39 #include "sound/WorldSound.h"40 37 #include "core/XMLPort.h" 41 38 -
code/branches/cpp11_v3/src/modules/jump/JumpPlatformFake.h
r10262 r11054 36 36 #define _JumpPlatformFake_H__ 37 37 38 #include "jump/JumpPrereqs.h" 39 40 #include "util/Math.h" 41 42 #include "worldentities/MovableEntity.h" 43 38 #include "JumpPrereqs.h" 39 #include "JumpPlatform.h" 44 40 45 41 namespace orxonox … … 50 46 JumpPlatformFake(Context* context); 51 47 virtual ~JumpPlatformFake(); 52 virtual void tick(float dt) ;53 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) ;48 virtual void tick(float dt) override; 49 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; 54 50 }; 55 51 } -
code/branches/cpp11_v3/src/modules/jump/JumpPlatformHMove.cc
r10262 r11054 33 33 34 34 #include "JumpPlatformHMove.h" 35 35 36 #include "core/CoreIncludes.h" 36 #include "core/GameMode.h" 37 #include "gametypes/Gametype.h" 37 #include "core/XMLPort.h" 38 38 #include "JumpFigure.h" 39 #include "sound/WorldSound.h"40 #include "core/XMLPort.h"41 39 42 40 namespace orxonox -
code/branches/cpp11_v3/src/modules/jump/JumpPlatformHMove.h
r10262 r11054 30 30 #define _JumpPlatformHMove_H__ 31 31 32 #include "jump/JumpPrereqs.h" 33 34 #include "util/Math.h" 35 36 #include "worldentities/MovableEntity.h" 37 32 #include "JumpPrereqs.h" 33 #include "JumpPlatform.h" 38 34 39 35 namespace orxonox … … 45 41 JumpPlatformHMove(Context* context); 46 42 virtual ~JumpPlatformHMove(); 47 virtual void tick(float dt) ;48 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) ;43 virtual void tick(float dt) override; 44 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; 49 45 virtual void setProperties(float leftBoundary, float rightBoundary, float speed); 50 virtual void touchFigure() ;46 virtual void touchFigure() override; 51 47 52 48 protected: -
code/branches/cpp11_v3/src/modules/jump/JumpPlatformStatic.cc
r10262 r11054 33 33 34 34 #include "JumpPlatformStatic.h" 35 35 36 #include "core/CoreIncludes.h" 36 #include "core/GameMode.h" 37 #include "gametypes/Gametype.h" 37 #include "core/XMLPort.h" 38 38 #include "JumpFigure.h" 39 #include "sound/WorldSound.h"40 #include "core/XMLPort.h"41 39 42 40 namespace orxonox -
code/branches/cpp11_v3/src/modules/jump/JumpPlatformStatic.h
r10262 r11054 30 30 #define _JumpPlatformStatic_H__ 31 31 32 #include "jump/JumpPrereqs.h" 33 34 #include "util/Math.h" 35 36 #include "worldentities/MovableEntity.h" 37 32 #include "JumpPrereqs.h" 33 #include "JumpPlatform.h" 38 34 39 35 namespace orxonox … … 45 41 virtual ~JumpPlatformStatic(); 46 42 47 virtual void tick(float dt) ;48 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) ;43 virtual void tick(float dt) override; 44 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; 49 45 50 virtual void touchFigure() ;46 virtual void touchFigure() override; 51 47 }; 52 48 } -
code/branches/cpp11_v3/src/modules/jump/JumpPlatformTimer.cc
r10262 r11054 33 33 34 34 #include "JumpPlatformTimer.h" 35 35 36 #include "core/CoreIncludes.h" 36 #include "core/ GameMode.h"37 #include "g ametypes/Gametype.h"37 #include "core/XMLPort.h" 38 #include "graphics/ParticleSpawner.h" 38 39 #include "JumpFigure.h" 39 #include "sound/WorldSound.h"40 #include "core/XMLPort.h"41 40 42 41 namespace orxonox … … 48 47 RegisterObject(JumpPlatformTimer); 49 48 50 particleSpawner_ = NULL;49 particleSpawner_ = nullptr; 51 50 52 51 setProperties(3.0); … … 72 71 73 72 time_ -= dt; 74 if (time_ < effectStartTime_ && particleSpawner_ == NULL)73 if (time_ < effectStartTime_ && particleSpawner_ == nullptr) 75 74 { 76 75 -
code/branches/cpp11_v3/src/modules/jump/JumpPlatformTimer.h
r10262 r11054 36 36 #define _JumpPlatformTimer_H__ 37 37 38 #include "jump/JumpPrereqs.h" 39 40 #include "util/Math.h" 41 42 #include "worldentities/MovableEntity.h" 43 #include "graphics/ParticleSpawner.h" 44 38 #include "JumpPrereqs.h" 39 #include "JumpPlatform.h" 45 40 46 41 namespace orxonox … … 51 46 JumpPlatformTimer(Context* context); 52 47 virtual ~JumpPlatformTimer(); 53 virtual void tick(float dt) ;54 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) ;48 virtual void tick(float dt) override; 49 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; 55 50 virtual void setProperties(float time); 56 51 virtual bool isActive(void); 57 virtual void touchFigure() ;52 virtual void touchFigure() override; 58 53 59 54 void setEffectPath(const std::string& effectPath) -
code/branches/cpp11_v3/src/modules/jump/JumpPlatformVMove.cc
r10262 r11054 33 33 34 34 #include "JumpPlatformVMove.h" 35 35 36 #include "core/CoreIncludes.h" 36 #include "core/GameMode.h" 37 #include "gametypes/Gametype.h" 37 #include "core/XMLPort.h" 38 38 #include "JumpFigure.h" 39 #include "sound/WorldSound.h"40 #include "core/XMLPort.h"41 39 42 40 namespace orxonox -
code/branches/cpp11_v3/src/modules/jump/JumpPlatformVMove.h
r10262 r11054 30 30 #define _JumpPlatformVMove_H__ 31 31 32 #include "jump/JumpPrereqs.h" 33 #include "util/Math.h" 34 #include "worldentities/MovableEntity.h" 32 #include "JumpPrereqs.h" 33 #include "JumpPlatform.h" 35 34 36 35 namespace orxonox … … 41 40 JumpPlatformVMove(Context* context); 42 41 virtual ~JumpPlatformVMove(); 43 virtual void tick(float dt) ;44 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) ;42 virtual void tick(float dt) override; 43 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; 45 44 virtual void setProperties(float leftBoundary, float rightBoundary, float speed); 46 virtual void touchFigure() ;45 virtual void touchFigure() override; 47 46 48 47 protected: -
code/branches/cpp11_v3/src/modules/jump/JumpProjectile.cc
r10624 r11054 33 33 34 34 #include "JumpProjectile.h" 35 35 36 #include "core/CoreIncludes.h" 36 #include "core/GameMode.h" 37 #include "graphics/Model.h" 38 #include "gametypes/Gametype.h" 37 #include "core/XMLPort.h" 39 38 #include "JumpFigure.h" 40 #include "sound/WorldSound.h" 41 #include "core/XMLPort.h" 39 #include "JumpEnemy.h" 42 40 43 41 namespace orxonox … … 49 47 RegisterObject(JumpProjectile); 50 48 51 figure_ = 0;49 figure_ = nullptr; 52 50 setPosition(Vector3(0,0,0)); 53 51 setVelocity(Vector3(0,0,250.0)); … … 71 69 Vector3 projectilePosition = getPosition(); 72 70 73 for ( ObjectList<JumpEnemy>::iterator it = ObjectList<JumpEnemy>::begin(); it != ObjectList<JumpEnemy>::end(); ++it)71 for (JumpEnemy* enemy : ObjectList<JumpEnemy>()) 74 72 { 75 Vector3 enemyPosition = it->getPosition();76 float enemyWidth = it->getWidth();77 float enemyHeight = it->getHeight();73 Vector3 enemyPosition = enemy->getPosition(); 74 float enemyWidth = enemy->getWidth(); 75 float enemyHeight = enemy->getHeight(); 78 76 79 77 if(projectilePosition.x > enemyPosition.x-enemyWidth && projectilePosition.x < enemyPosition.x+enemyWidth && projectilePosition.z > enemyPosition.z-enemyHeight && projectilePosition.z < enemyPosition.z+enemyHeight) 80 78 { 81 it->dead_ = true;79 enemy->dead_ = true; 82 80 } 83 81 } -
code/branches/cpp11_v3/src/modules/jump/JumpProjectile.h
r10624 r11054 43 43 virtual ~JumpProjectile(); 44 44 45 virtual void tick(float dt) ;45 virtual void tick(float dt) override; 46 46 47 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) ;47 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; 48 48 49 49 void setFieldDimension(float width, float height) -
code/branches/cpp11_v3/src/modules/jump/JumpPropeller.cc
r10262 r11054 35 35 36 36 #include "core/CoreIncludes.h" 37 #include "core/GameMode.h" 38 #include "graphics/Model.h" 39 #include "gametypes/Gametype.h" 40 37 #include "core/XMLPort.h" 41 38 #include "JumpFigure.h" 42 43 #include "sound/WorldSound.h"44 #include "core/XMLPort.h"45 39 46 40 namespace orxonox … … 78 72 Vector3 PropellerPosition = getWorldPosition(); 79 73 80 if (attachedToFigure_ == false && figure_ != NULL)74 if (attachedToFigure_ == false && figure_ != nullptr) 81 75 { 82 76 Vector3 figurePosition = figure_->getWorldPosition(); -
code/branches/cpp11_v3/src/modules/jump/JumpPropeller.h
r10262 r11054 30 30 #define _JumpPropeller_H__ 31 31 32 #include "jump/JumpPrereqs.h" 33 34 #include "util/Math.h" 35 36 #include "worldentities/MovableEntity.h" 37 32 #include "JumpPrereqs.h" 33 #include "JumpItem.h" 38 34 39 35 namespace orxonox … … 44 40 JumpPropeller(Context* context); 45 41 virtual ~JumpPropeller(); 46 virtual void tick(float dt) ;47 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) ;48 virtual void touchFigure() ;42 virtual void tick(float dt) override; 43 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; 44 virtual void touchFigure() override; 49 45 virtual float getFuelState(); 50 46 protected: -
code/branches/cpp11_v3/src/modules/jump/JumpRocket.cc
r10262 r11054 33 33 34 34 #include "JumpRocket.h" 35 35 36 #include "core/CoreIncludes.h" 36 #include "core/GameMode.h" 37 #include "graphics/Model.h" 38 #include "gametypes/Gametype.h" 37 #include "core/XMLPort.h" 39 38 #include "JumpFigure.h" 40 #include "sound/WorldSound.h"41 #include "core/XMLPort.h"42 39 43 40 namespace orxonox … … 75 72 Vector3 rocketPosition = getWorldPosition(); 76 73 77 if (attachedToFigure_ == false && figure_ != NULL)74 if (attachedToFigure_ == false && figure_ != nullptr) 78 75 { 79 76 Vector3 figurePosition = figure_->getWorldPosition(); -
code/branches/cpp11_v3/src/modules/jump/JumpRocket.h
r10262 r11054 30 30 #define _JumpRocket_H__ 31 31 32 #include "jump/JumpPrereqs.h" 33 #include "util/Math.h" 34 #include "worldentities/MovableEntity.h" 32 #include "JumpPrereqs.h" 33 #include "JumpItem.h" 35 34 36 35 namespace orxonox … … 41 40 JumpRocket(Context* context); 42 41 virtual ~JumpRocket(); 43 virtual void tick(float dt) ;44 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) ;45 virtual void touchFigure() ;42 virtual void tick(float dt) override; 43 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; 44 virtual void touchFigure() override; 46 45 virtual float getFuelState(); 47 46 protected: -
code/branches/cpp11_v3/src/modules/jump/JumpScore.cc
r10624 r11054 33 33 34 34 #include "JumpScore.h" 35 35 36 #include "core/CoreIncludes.h" 36 37 #include "core/XMLPort.h" … … 38 39 #include "infos/PlayerInfo.h" 39 40 #include "Jump.h" 40 #include "sound/WorldSound.h"41 41 42 42 namespace orxonox … … 48 48 RegisterObject(JumpScore); 49 49 50 owner_ = NULL;50 owner_ = nullptr; 51 51 showScore_ = false; 52 52 showFuel_ = false; … … 73 73 SUPER(JumpScore, tick, dt); 74 74 75 if (owner_ != NULL)75 if (owner_ != nullptr) 76 76 { 77 77 if (!owner_->hasEnded()) … … 79 79 player_ = owner_->getPlayer(); 80 80 81 if (player_ != NULL)81 if (player_ != nullptr) 82 82 { 83 83 if (showScore_ == true) … … 116 116 SUPER(JumpScore, changedOwner); 117 117 118 if (this->getOwner() != NULL&& this->getOwner()->getGametype())118 if (this->getOwner() != nullptr && this->getOwner()->getGametype()) 119 119 { 120 120 this->owner_ = orxonox_cast<Jump*>(this->getOwner()->getGametype()); … … 122 122 else 123 123 { 124 this->owner_ = NULL;124 this->owner_ = nullptr; 125 125 } 126 126 } -
code/branches/cpp11_v3/src/modules/jump/JumpScore.h
r10262 r11054 44 44 virtual ~JumpScore(); 45 45 46 virtual void tick(float dt) ;47 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) ;48 virtual void changedOwner() ;46 virtual void tick(float dt) override; 47 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; 48 virtual void changedOwner() override; 49 49 50 50 void setShowScore(const bool showScore) -
code/branches/cpp11_v3/src/modules/jump/JumpShield.cc
r10262 r11054 35 35 36 36 #include "core/CoreIncludes.h" 37 #include "core/GameMode.h" 38 #include "graphics/Model.h" 39 #include "gametypes/Gametype.h" 40 37 #include "core/XMLPort.h" 41 38 #include "JumpFigure.h" 42 43 #include "sound/WorldSound.h"44 #include "core/XMLPort.h"45 39 46 40 namespace orxonox … … 78 72 Vector3 shieldPosition = getWorldPosition(); 79 73 80 if (attachedToFigure_ == false && figure_ != NULL)74 if (attachedToFigure_ == false && figure_ != nullptr) 81 75 { 82 76 Vector3 figurePosition = figure_->getWorldPosition(); -
code/branches/cpp11_v3/src/modules/jump/JumpShield.h
r10262 r11054 30 30 #define _JumpShield_H__ 31 31 32 #include "jump/JumpPrereqs.h" 33 34 #include "util/Math.h" 35 36 #include "worldentities/MovableEntity.h" 37 32 #include "JumpPrereqs.h" 33 #include "JumpItem.h" 38 34 39 35 namespace orxonox … … 44 40 JumpShield(Context* context); 45 41 virtual ~JumpShield(); 46 virtual void tick(float dt) ;47 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) ;48 virtual void touchFigure() ;42 virtual void tick(float dt) override; 43 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; 44 virtual void touchFigure() override; 49 45 virtual float getFuelState(); 50 46 protected: -
code/branches/cpp11_v3/src/modules/jump/JumpSpring.cc
r10262 r11054 33 33 34 34 #include "JumpSpring.h" 35 35 36 #include "core/CoreIncludes.h" 36 #include "core/GameMode.h" 37 #include "graphics/Model.h" 38 #include "gametypes/Gametype.h" 37 #include "core/XMLPort.h" 39 38 #include "JumpFigure.h" 40 #include "sound/WorldSound.h"41 #include "core/XMLPort.h"42 39 43 40 namespace orxonox … … 80 77 Vector3 springPosition = getWorldPosition(); 81 78 82 if (figure_ != NULL)79 if (figure_ != nullptr) 83 80 { 84 81 Vector3 figurePosition = figure_->getWorldPosition(); … … 103 100 void JumpSpring::accelerateFigure() 104 101 { 105 if (figure_ != 0)102 if (figure_ != nullptr) 106 103 { 107 104 figure_->JumpFromSpring(this); -
code/branches/cpp11_v3/src/modules/jump/JumpSpring.h
r10262 r11054 30 30 #define _JumpSpring_H__ 31 31 32 #include "jump/JumpPrereqs.h" 33 34 #include "util/Math.h" 35 36 #include "worldentities/MovableEntity.h" 37 32 #include "JumpPrereqs.h" 33 #include "JumpItem.h" 38 34 39 35 namespace orxonox … … 44 40 JumpSpring(Context* context); 45 41 virtual ~JumpSpring(); 46 virtual void tick(float dt) ;47 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) ;42 virtual void tick(float dt) override; 43 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; 48 44 virtual void accelerateFigure(); 49 virtual void touchFigure() ;45 virtual void touchFigure() override; 50 46 protected: 51 47 float stretch_;
Note: See TracChangeset
for help on using the changeset viewer.