Changeset 10765 for code/branches/cpp11_v2/src/modules/jump
- Timestamp:
- Nov 4, 2015, 10:25:42 PM (9 years ago)
- Location:
- code/branches/cpp11_v2/src/modules/jump
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/cpp11_v2/src/modules/jump/Jump.cc
r10733 r10765 83 83 SUPER(Jump, tick, dt); 84 84 85 if (figure_ != NULL)85 if (figure_ != nullptr) 86 86 { 87 87 Vector3 figurePosition = figure_->getPosition(); … … 130 130 131 131 132 if (camera != NULL)132 if (camera != nullptr) 133 133 { 134 134 Vector3 cameraPosition = Vector3(0, totalScreenShift_, 0); … … 275 275 void Jump::start() 276 276 { 277 if (center_ != NULL) // There needs to be a JumpCenterpoint, i.e. the area the game takes place.278 { 279 if (figure_ == NULL)277 if (center_ != nullptr) // There needs to be a JumpCenterpoint, i.e. the area the game takes place. 278 { 279 if (figure_ == nullptr) 280 280 { 281 281 figure_ = new JumpFigure(center_->getContext()); … … 298 298 Deathmatch::start(); 299 299 300 if (figure_ != NULL)300 if (figure_ != nullptr) 301 301 { 302 302 camera = figure_->getCamera(); … … 325 325 assert(player); 326 326 327 if (figure_->getPlayer() == NULL)327 if (figure_->getPlayer() == nullptr) 328 328 { 329 329 player->startControl(figure_); … … 334 334 PlayerInfo* Jump::getPlayer() const 335 335 { 336 if (this->figure_ != NULL)336 if (this->figure_ != nullptr) 337 337 { 338 338 return this->figure_->getPlayer(); … … 346 346 void Jump::addPlatform(JumpPlatform* newPlatform, std::string platformTemplate, float xPosition, float zPosition) 347 347 { 348 if (newPlatform != NULL && center_ != NULL)348 if (newPlatform != nullptr && center_ != nullptr) 349 349 { 350 350 newPlatform->addTemplate(platformTemplate); … … 414 414 { 415 415 JumpProjectile* newProjectile = new JumpProjectile(center_->getContext()); 416 if (newProjectile != NULL && center_ != NULL)416 if (newProjectile != nullptr && center_ != nullptr) 417 417 { 418 418 newProjectile->addTemplate(center_->getProjectileTemplate()); … … 427 427 { 428 428 JumpSpring* newSpring = new JumpSpring(center_->getContext()); 429 if (newSpring != NULL && center_ != NULL)429 if (newSpring != nullptr && center_ != nullptr) 430 430 { 431 431 newSpring->addTemplate(center_->getSpringTemplate()); … … 440 440 { 441 441 JumpSpring* newSpring = new JumpSpring(center_->getContext()); 442 if (newSpring != NULL && center_ != NULL)442 if (newSpring != nullptr && center_ != nullptr) 443 443 { 444 444 newSpring->addTemplate(center_->getSpringTemplate()); … … 453 453 { 454 454 JumpRocket* newRocket = new JumpRocket(center_->getContext()); 455 if (newRocket != NULL && center_ != NULL)455 if (newRocket != nullptr && center_ != nullptr) 456 456 { 457 457 newRocket->addTemplate(center_->getRocketTemplate()); … … 466 466 { 467 467 JumpRocket* newRocket = new JumpRocket(center_->getContext()); 468 if (newRocket != NULL && center_ != NULL)468 if (newRocket != nullptr && center_ != nullptr) 469 469 { 470 470 newRocket->addTemplate(center_->getRocketTemplate()); … … 479 479 { 480 480 JumpPropeller* newPropeller = new JumpPropeller(center_->getContext()); 481 if (newPropeller != NULL && center_ != NULL)481 if (newPropeller != nullptr && center_ != nullptr) 482 482 { 483 483 newPropeller->addTemplate(center_->getPropellerTemplate()); … … 492 492 { 493 493 JumpPropeller* newPropeller = new JumpPropeller(center_->getContext()); 494 if (newPropeller != NULL && center_ != NULL)494 if (newPropeller != nullptr && center_ != nullptr) 495 495 { 496 496 newPropeller->addTemplate(center_->getPropellerTemplate()); … … 505 505 { 506 506 JumpBoots* newBoots = new JumpBoots(center_->getContext()); 507 if (newBoots != NULL && center_ != NULL)507 if (newBoots != nullptr && center_ != nullptr) 508 508 { 509 509 newBoots->addTemplate(center_->getBootsTemplate()); … … 518 518 { 519 519 JumpBoots* newBoots = new JumpBoots(center_->getContext()); 520 if (newBoots != NULL && center_ != NULL)520 if (newBoots != nullptr && center_ != nullptr) 521 521 { 522 522 newBoots->addTemplate(center_->getBootsTemplate()); … … 531 531 { 532 532 JumpShield* newShield = new JumpShield(center_->getContext()); 533 if (newShield != NULL && center_ != NULL)533 if (newShield != nullptr && center_ != nullptr) 534 534 { 535 535 newShield->addTemplate(center_->getShieldTemplate()); … … 544 544 { 545 545 JumpShield* newShield = new JumpShield(center_->getContext()); 546 if (newShield != NULL && center_ != NULL)546 if (newShield != nullptr && center_ != nullptr) 547 547 { 548 548 newShield->addTemplate(center_->getShieldTemplate()); … … 557 557 { 558 558 JumpEnemy* newEnemy = new JumpEnemy(center_->getContext()); 559 if (newEnemy != NULL && center_ != NULL)559 if (newEnemy != nullptr && center_ != nullptr) 560 560 { 561 561 switch (type) … … 1270 1270 float Jump::getFuel() const 1271 1271 { 1272 if (this->figure_ != NULL)1273 { 1274 if (this->figure_->rocketActive_ != NULL)1272 if (this->figure_ != nullptr) 1273 { 1274 if (this->figure_->rocketActive_ != nullptr) 1275 1275 { 1276 1276 return this->figure_->rocketActive_->getFuelState(); 1277 1277 } 1278 else if (this->figure_->propellerActive_ != NULL)1278 else if (this->figure_->propellerActive_ != nullptr) 1279 1279 { 1280 1280 return this->figure_->propellerActive_->getFuelState(); 1281 1281 } 1282 else if (this->figure_->shieldActive_ != NULL)1282 else if (this->figure_->shieldActive_ != nullptr) 1283 1283 { 1284 1284 return this->figure_->shieldActive_->getFuelState(); 1285 1285 } 1286 else if (this->figure_->bootsActive_ != NULL)1286 else if (this->figure_->bootsActive_ != nullptr) 1287 1287 { 1288 1288 return this->figure_->bootsActive_->getFuelState(); -
code/branches/cpp11_v2/src/modules/jump/JumpBoots.cc
r10733 r10765 72 72 Vector3 rocketPosition = getWorldPosition(); 73 73 74 if (attachedToFigure_ == false && figure_ != NULL)74 if (attachedToFigure_ == false && figure_ != nullptr) 75 75 { 76 76 Vector3 figurePosition = figure_->getWorldPosition(); -
code/branches/cpp11_v2/src/modules/jump/JumpCenterpoint.cc
r10733 r10765 83 83 void JumpCenterpoint::checkGametype() 84 84 { 85 if (getGametype() != NULL&& this->getGametype()->isA(Class(Jump)))85 if (getGametype() != nullptr && this->getGametype()->isA(Class(Jump))) 86 86 { 87 87 Jump* jumpGametype = orxonox_cast<Jump*>(this->getGametype()); -
code/branches/cpp11_v2/src/modules/jump/JumpEnemy.cc
r10733 r10765 119 119 Vector3 enemyPosition = getPosition(); 120 120 121 if (figure_ != NULL)121 if (figure_ != nullptr) 122 122 { 123 123 Vector3 figurePosition = figure_->getPosition(); -
code/branches/cpp11_v2/src/modules/jump/JumpFigure.cc
r10733 r10765 51 51 52 52 // initialize variables 53 leftHand_ = NULL;54 rightHand_ = NULL;53 leftHand_ = nullptr; 54 rightHand_ = nullptr; 55 55 fieldHeight_ = 0; 56 56 fieldWidth_ = 0; … … 75 75 animateHands_ = false; 76 76 turnUp_ = false; 77 rocketActive_ = NULL;78 propellerActive_ = NULL;79 bootsActive_ = NULL;80 shieldActive_ = NULL;77 rocketActive_ = nullptr; 78 propellerActive_ = nullptr; 79 bootsActive_ = nullptr; 80 shieldActive_ = nullptr; 81 81 rocketSpeed_ = 0.0; 82 82 propellerSpeed_ = 0.0; … … 111 111 // Move up/down 112 112 Vector3 velocity = getVelocity(); 113 if (rocketActive_ != NULL)113 if (rocketActive_ != nullptr) 114 114 { 115 115 velocity.z = rocketSpeed_; 116 116 } 117 else if (propellerActive_ != NULL)117 else if (propellerActive_ != nullptr) 118 118 { 119 119 velocity.z = propellerSpeed_; … … 144 144 } 145 145 146 if (leftHand_ != NULL)146 if (leftHand_ != nullptr) 147 147 { 148 148 leftHand_->setOrientation(Vector3(0.0, 1.0, 0.0), Degree(-handAngle_)); 149 149 } 150 if (rightHand_ != NULL)150 if (rightHand_ != nullptr) 151 151 { 152 152 rightHand_->setOrientation(Vector3(0.0, 1.0, 0.0), Degree(handAngle_)); … … 212 212 { 213 213 Vector3 velocity = getVelocity(); 214 if (bootsActive_ == NULL)214 if (bootsActive_ == nullptr) 215 215 { 216 216 velocity.z = 1.2f*jumpSpeed_; … … 239 239 void JumpFigure::CollisionWithEnemy(JumpEnemy* enemy) 240 240 { 241 if (rocketActive_ == NULL && propellerActive_ == NULL && shieldActive_ == NULL)241 if (rocketActive_ == nullptr && propellerActive_ == nullptr && shieldActive_ == nullptr) 242 242 { 243 243 dead_ = true; … … 247 247 bool JumpFigure::StartRocket(JumpRocket* rocket) 248 248 { 249 if (rocketActive_ == NULL && propellerActive_ == NULL && bootsActive_ == NULL)249 if (rocketActive_ == nullptr && propellerActive_ == nullptr && bootsActive_ == nullptr) 250 250 { 251 251 attach(rocket); … … 266 266 detach(rocket); 267 267 rocket->destroy(); 268 rocketActive_ = NULL;268 rocketActive_ = nullptr; 269 269 } 270 270 271 271 bool JumpFigure::StartPropeller(JumpPropeller* propeller) 272 272 { 273 if (rocketActive_ == NULL && propellerActive_ == NULL && bootsActive_ == NULL)273 if (rocketActive_ == nullptr && propellerActive_ == nullptr && bootsActive_ == nullptr) 274 274 { 275 275 attach(propeller); … … 290 290 detach(propeller); 291 291 propeller->destroy(); 292 propellerActive_ = NULL;292 propellerActive_ = nullptr; 293 293 } 294 294 295 295 bool JumpFigure::StartBoots(JumpBoots* boots) 296 296 { 297 if (rocketActive_ == NULL && propellerActive_ == NULL && bootsActive_ == NULL)297 if (rocketActive_ == nullptr && propellerActive_ == nullptr && bootsActive_ == nullptr) 298 298 { 299 299 attach(boots); … … 314 314 detach(boots); 315 315 boots->destroy(); 316 bootsActive_ = NULL;316 bootsActive_ = nullptr; 317 317 } 318 318 … … 338 338 detach(shield); 339 339 shield->destroy(); 340 shieldActive_ = NULL;340 shieldActive_ = nullptr; 341 341 } 342 342 -
code/branches/cpp11_v2/src/modules/jump/JumpPlatform.cc
r10733 r10765 86 86 Vector3 platformPosition = this->getPosition(); 87 87 88 if (figure_ != NULL)88 if (figure_ != nullptr) 89 89 { 90 90 Vector3 figurePosition = figure_->getPosition(); -
code/branches/cpp11_v2/src/modules/jump/JumpPlatformTimer.cc
r10733 r10765 47 47 RegisterObject(JumpPlatformTimer); 48 48 49 particleSpawner_ = NULL;49 particleSpawner_ = nullptr; 50 50 51 51 setProperties(3.0); … … 71 71 72 72 time_ -= dt; 73 if (time_ < effectStartTime_ && particleSpawner_ == NULL)73 if (time_ < effectStartTime_ && particleSpawner_ == nullptr) 74 74 { 75 75 -
code/branches/cpp11_v2/src/modules/jump/JumpPropeller.cc
r10733 r10765 72 72 Vector3 PropellerPosition = getWorldPosition(); 73 73 74 if (attachedToFigure_ == false && figure_ != NULL)74 if (attachedToFigure_ == false && figure_ != nullptr) 75 75 { 76 76 Vector3 figurePosition = figure_->getWorldPosition(); -
code/branches/cpp11_v2/src/modules/jump/JumpRocket.cc
r10733 r10765 72 72 Vector3 rocketPosition = getWorldPosition(); 73 73 74 if (attachedToFigure_ == false && figure_ != NULL)74 if (attachedToFigure_ == false && figure_ != nullptr) 75 75 { 76 76 Vector3 figurePosition = figure_->getWorldPosition(); -
code/branches/cpp11_v2/src/modules/jump/JumpScore.cc
r10733 r10765 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_v2/src/modules/jump/JumpShield.cc
r10733 r10765 72 72 Vector3 shieldPosition = getWorldPosition(); 73 73 74 if (attachedToFigure_ == false && figure_ != NULL)74 if (attachedToFigure_ == false && figure_ != nullptr) 75 75 { 76 76 Vector3 figurePosition = figure_->getWorldPosition(); -
code/branches/cpp11_v2/src/modules/jump/JumpSpring.cc
r10733 r10765 77 77 Vector3 springPosition = getWorldPosition(); 78 78 79 if (figure_ != NULL)79 if (figure_ != nullptr) 80 80 { 81 81 Vector3 figurePosition = figure_->getWorldPosition();
Note: See TracChangeset
for help on using the changeset viewer.