Changeset 10765 for code/branches/cpp11_v2/src/modules/jump/Jump.cc
- Timestamp:
- Nov 4, 2015, 10:25:42 PM (9 years ago)
- File:
-
- 1 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();
Note: See TracChangeset
for help on using the changeset viewer.