Changeset 10765 for code/branches/cpp11_v2/src/modules
- Timestamp:
- Nov 4, 2015, 10:25:42 PM (9 years ago)
- Location:
- code/branches/cpp11_v2/src/modules
- Files:
-
- 93 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/cpp11_v2/src/modules/designtools/ScreenshotManager.cc
r10624 r10765 69 69 Constructor. 70 70 */ 71 ScreenshotManager::ScreenshotManager() : finalPicturePB_( NULL), data_(NULL)71 ScreenshotManager::ScreenshotManager() : finalPicturePB_(nullptr), data_(nullptr) 72 72 { 73 73 RegisterObject(ScreenshotManager); … … 90 90 void ScreenshotManager::cleanup(void) 91 91 { 92 if(this->finalPicturePB_ != NULL)92 if(this->finalPicturePB_ != nullptr) 93 93 { 94 94 delete this->finalPicturePB_; 95 this->finalPicturePB_ = NULL;96 } 97 if(this->data_ != NULL)95 this->finalPicturePB_ = nullptr; 96 } 97 if(this->data_ != nullptr) 98 98 { 99 99 delete this->data_; 100 this->data_ = NULL;100 this->data_ = nullptr; 101 101 } 102 102 if(!this->tempTexture_.isNull()) … … 151 151 // Get the screenshot. 152 152 Ogre::Image* finalImage = getScreenshot(); 153 if(finalImage != NULL)153 if(finalImage != nullptr) 154 154 { 155 155 // Save it. … … 173 173 Ogre::Image* ScreenshotManager::getScreenshot() 174 174 { 175 if(CameraManager::getInstance().getActiveCamera() == NULL)176 return NULL;175 if(CameraManager::getInstance().getActiveCamera() == nullptr ) 176 return nullptr; 177 177 return this->getScreenshot(CameraManager::getInstance().getActiveCamera()->getOgreCamera()); 178 178 } … … 189 189 Ogre::Image* ScreenshotManager::getScreenshot(Ogre::Camera* camera) 190 190 { 191 if(camera == NULL)192 return NULL;191 if(camera == nullptr) 192 return nullptr; 193 193 194 194 // Update the internal parameters. -
code/branches/cpp11_v2/src/modules/designtools/SkyboxGenerator.cc
r10624 r10765 146 146 } 147 147 148 ControllableEntity* entity = NULL;149 if(HumanController::getLocalControllerSingleton() != NULL && HumanController::getLocalControllerSingleton()->getControllableEntity() != NULL)148 ControllableEntity* entity = nullptr; 149 if(HumanController::getLocalControllerSingleton() != nullptr && HumanController::getLocalControllerSingleton()->getControllableEntity() != nullptr) 150 150 entity = HumanController::getLocalControllerSingleton()->getControllableEntity(); 151 151 else -
code/branches/cpp11_v2/src/modules/docking/Dock.cc
r10624 r10765 87 87 88 88 PlayerTrigger* pTrigger = orxonox_cast<PlayerTrigger*>(trigger); 89 PlayerInfo* player = NULL;89 PlayerInfo* player = nullptr; 90 90 91 91 // Check whether it is a player trigger and extract pawn from it 92 if(pTrigger != NULL)92 if(pTrigger != nullptr) 93 93 { 94 94 if(!pTrigger->isForPlayer()) { // The PlayerTrigger is not exclusively for Pawns which means we cannot extract one. … … 103 103 return false; 104 104 } 105 if(player == NULL)105 if(player == nullptr) 106 106 { 107 107 orxout(verbose, context::docking) << "Docking::execute Can't retrieve PlayerInfo from Trigger. (" << trigger->getIdentifier()->getName() << ")" << endl; … … 131 131 { 132 132 PlayerTrigger* pTrigger = orxonox_cast<PlayerTrigger*>(trigger); 133 PlayerInfo* player = NULL;133 PlayerInfo* player = nullptr; 134 134 135 135 // Check whether it is a player trigger and extract pawn from it 136 if(pTrigger != NULL)136 if(pTrigger != nullptr) 137 137 { 138 138 if(!pTrigger->isForPlayer()) { // The PlayerTrigger is not exclusively for Pawns which means we cannot extract one. … … 147 147 return false; 148 148 } 149 if(player == NULL)149 if(player == nullptr) 150 150 { 151 151 orxout(verbose, context::docking) << "Docking::execute Can't retrieve PlayerInfo from Trigger. (" << trigger->getIdentifier()->getName() << ")" << endl; … … 315 315 } 316 316 } 317 return NULL;317 return nullptr; 318 318 } 319 319 … … 333 333 i--; 334 334 } 335 return NULL;335 return nullptr; 336 336 } 337 337 … … 352 352 i--; 353 353 } 354 return NULL;354 return nullptr; 355 355 } 356 356 } -
code/branches/cpp11_v2/src/modules/docking/DockToShip.cc
r9974 r10765 72 72 73 73 DockingTarget *target = DockingEffect::findTarget(this->target_); 74 if (target == NULL) {74 if (target == nullptr) { 75 75 orxout(internal_warning, context::docking) << "Can't retrieve target for '" << this->target_ << "'.." << endl; 76 76 return false; … … 78 78 79 79 ControllableEntity *dockTo = (ControllableEntity*) target->getParent(); 80 if (dockTo == NULL) {80 if (dockTo == nullptr) { 81 81 orxout(internal_warning, context::docking) << "Parent is not a ControllableEntity.." << endl; 82 82 return false; -
code/branches/cpp11_v2/src/modules/docking/DockingAnimation.cc
r10624 r10765 45 45 RegisterObject(DockingAnimation); 46 46 47 this->parent_ = NULL;47 this->parent_ = nullptr; 48 48 } 49 49 -
code/branches/cpp11_v2/src/modules/docking/DockingController.cc
r9667 r10765 44 44 RegisterObject(DockingController); 45 45 46 this->dock_ = NULL;47 this->player_ = NULL;48 this->entity_ = NULL;46 this->dock_ = nullptr; 47 this->player_ = nullptr; 48 this->entity_ = nullptr; 49 49 } 50 50 … … 122 122 this->player_->startControl(this->entity_); 123 123 this->setActive(false); 124 this->controllableEntity_ = NULL;124 this->controllableEntity_ = nullptr; 125 125 126 126 if (this->docking_) -
code/branches/cpp11_v2/src/modules/docking/DockingEffect.cc
r10624 r10765 70 70 return (*it); 71 71 } 72 return NULL;72 return nullptr; 73 73 } 74 74 } -
code/branches/cpp11_v2/src/modules/dodgerace/DodgeRace.cc
r10624 r10765 67 67 { 68 68 level++; 69 if (getPlayer() != NULL)69 if (getPlayer() != nullptr) 70 70 { 71 71 for (int i = 0; i < 7; i++) … … 85 85 void DodgeRace::tick(float dt) 86 86 { 87 if (getPlayer() != NULL)87 if (getPlayer() != nullptr) 88 88 { 89 89 currentPosition = getPlayer()->getWorldPosition().x; … … 134 134 DodgeRaceShip* DodgeRace::getPlayer() 135 135 { 136 if (player == NULL)136 if (player == nullptr) 137 137 { 138 138 for (ObjectList<DodgeRaceShip>::iterator it = ObjectList<DodgeRaceShip>::begin(); it != ObjectList<DodgeRaceShip>::end(); ++it) … … 173 173 this->bForceSpawn_ = false; 174 174 175 if (this->center_ == NULL) // abandon mission!175 if (this->center_ == nullptr) // abandon mission! 176 176 { 177 177 orxout(internal_error) << "DodgeRace: No Centerpoint specified." << endl; -
code/branches/cpp11_v2/src/modules/dodgerace/DodgeRaceCenterPoint.cc
r10624 r10765 56 56 void DodgeRaceCenterPoint::checkGametype() 57 57 { 58 if (this->getGametype() != NULL&& this->getGametype()->isA(Class(DodgeRace)))58 if (this->getGametype() != nullptr && this->getGametype()->isA(Class(DodgeRace))) 59 59 { 60 60 DodgeRace* DodgeRaceGametype = orxonox_cast<DodgeRace*>(this->getGametype()); -
code/branches/cpp11_v2/src/modules/dodgerace/DodgeRaceShip.cc
r10624 r10765 91 91 // Camera 92 92 Camera* camera = this->getCamera(); 93 if (camera != NULL)93 if (camera != nullptr) 94 94 { 95 95 // camera->setPosition(Vector3(-pos.z, -posforeward, 0)); … … 152 152 DodgeRace* DodgeRaceShip::getGame() 153 153 { 154 if (game == NULL)154 if (game == nullptr) 155 155 { 156 156 for (ObjectList<DodgeRace>::iterator it = ObjectList<DodgeRace>::begin(); it != ObjectList<DodgeRace>::end(); ++it) -
code/branches/cpp11_v2/src/modules/gametypes/RaceCheckPoint.cc
r9973 r10765 125 125 } 126 126 } 127 return NULL;127 return nullptr; 128 128 } 129 129 -
code/branches/cpp11_v2/src/modules/gametypes/SpaceRaceController.cc
r10318 r10765 98 98 RaceCheckPoint* point2 = findCheckpoint((*numb)); 99 99 100 //if(point2 != NULL)100 //if(point2 != nullptr) 101 101 //placeVirtualCheckpoints((*it), point2); 102 102 } … … 126 126 staticRacePoints_ = findStaticCheckpoints(nextRaceCheckpoint_, checkpoints); 127 127 // initialisation of currentRaceCheckpoint_ 128 currentRaceCheckpoint_ = NULL;128 currentRaceCheckpoint_ = nullptr; 129 129 130 130 int i; 131 for (i = -2; findCheckpoint(i) != NULL; i--)131 for (i = -2; findCheckpoint(i) != nullptr; i--) 132 132 { 133 133 continue; … … 194 194 continue; 195 195 } 196 if (findCheckpoint(*it) == NULL)196 if (findCheckpoint(*it) == nullptr) 197 197 orxout(internal_warning) << "Problematic Point: " << (*it) << endl; 198 198 else … … 209 209 float SpaceRaceController::distanceSpaceshipToCheckPoint(RaceCheckPoint* CheckPoint) 210 210 { 211 if (this->getControllableEntity() != NULL)211 if (this->getControllableEntity() != nullptr) 212 212 { 213 213 return (CheckPoint->getPosition()- this->getControllableEntity()->getPosition()).length(); … … 223 223 { 224 224 float minDistance = 0; 225 RaceCheckPoint* minNextRaceCheckPoint = NULL;225 RaceCheckPoint* minNextRaceCheckPoint = nullptr; 226 226 227 227 // find the next checkpoint with the minimal distance … … 231 231 float distance = recCalculateDistance(nextRaceCheckPoint, this->getControllableEntity()->getPosition()); 232 232 233 if (distance < minDistance || minNextRaceCheckPoint == NULL)233 if (distance < minDistance || minNextRaceCheckPoint == nullptr) 234 234 { 235 235 minDistance = distance; … … 271 271 RaceCheckPoint* SpaceRaceController::adjustNextPoint() 272 272 { 273 if (currentRaceCheckpoint_ == NULL) // no Adjust possible273 if (currentRaceCheckpoint_ == nullptr) // no Adjust possible 274 274 275 275 { … … 292 292 if (this->checkpoints_[i]->getCheckpointIndex() == index) 293 293 return this->checkpoints_[i]; 294 return NULL;294 return nullptr; 295 295 } 296 296 … … 347 347 void SpaceRaceController::tick(float dt) 348 348 { 349 if (this->getControllableEntity() == NULL || this->getControllableEntity()->getPlayer() == NULL)349 if (this->getControllableEntity() == nullptr || this->getControllableEntity()->getPlayer() == nullptr ) 350 350 { 351 351 //orxout()<< this->getControllableEntity() << " in tick"<<endl; … … 419 419 { 420 420 btCollisionShape* currentShape = (*it)->getAttachedCollisionShape(everyShape)->getCollisionShape(); 421 if(currentShape == NULL)421 if(currentShape == nullptr) 422 422 continue; 423 423 … … 447 447 { 448 448 btCollisionShape* currentShape = (*it)->getAttachedCollisionShape(everyShape)->getCollisionShape(); 449 if(currentShape == NULL)449 if(currentShape == nullptr) 450 450 continue; 451 451 … … 491 491 { 492 492 493 if (dynamic_cast<RaceCheckPoint*>(*it) != NULL)493 if (dynamic_cast<RaceCheckPoint*>(*it) != nullptr) 494 494 { 495 495 continue; … … 537 537 // btVector3 positionObject; 538 538 // btScalar radiusObject; 539 // if((*it)== NULL)539 // if((*it)==nullptr) 540 540 // { orxout()<<"Problempoint 1.1"<<endl; continue;} 541 541 // //TODO: Probably it points on a wrong object 542 542 // for (int everyShape=0; (*it)->getAttachedCollisionShape(everyShape)!=0; everyShape++) 543 543 // { 544 // if((*it)->getAttachedCollisionShape(everyShape)->getCollisionShape()== NULL)544 // if((*it)->getAttachedCollisionShape(everyShape)->getCollisionShape()==nullptr) 545 545 // { continue;} 546 546 // … … 570 570 // btVector3 positionObject; 571 571 // btScalar radiusObject; 572 // if((*it)== NULL)572 // if((*it)==nullptr) 573 573 // { orxout()<<"Problempoint 1"<<endl; continue;} 574 574 // for (int everyShape=0; (*it)->getAttachedCollisionShape(everyShape)!=0; everyShape++) 575 575 // { 576 // if((*it)->getAttachedCollisionShape(everyShape)->getCollisionShape()== NULL)576 // if((*it)->getAttachedCollisionShape(everyShape)->getCollisionShape()==nullptr) 577 577 // { orxout()<<"Problempoint 2.2"<<endl; continue;} 578 578 // (*it)->getAttachedCollisionShape(everyShape)->getCollisionShape()->getBoundingSphere(positionObject,radiusObject); -
code/branches/cpp11_v2/src/modules/gametypes/SpaceRaceManager.cc
r10624 r10765 71 71 this->players_ = this->race_->getPlayers(); 72 72 73 if (this->checkpoints_[0] != NULL&& !this->firstcheckpointvisible_)73 if (this->checkpoints_[0] != nullptr && !this->firstcheckpointvisible_) 74 74 { 75 75 this->checkpoints_[0]->setRadarVisibility(true); … … 121 121 bool SpaceRaceManager::reachedValidCheckpoint(RaceCheckPoint* oldCheckpoint, RaceCheckPoint* newCheckpoint, PlayerInfo* player) const 122 122 { 123 if (oldCheckpoint != NULL)123 if (oldCheckpoint != nullptr) 124 124 { 125 125 // the player already visited an old checkpoint; see which checkpoints are possible now -
code/branches/cpp11_v2/src/modules/invader/Invader.cc
r10733 r10765 78 78 { 79 79 level++; 80 if (getPlayer() != NULL)80 if (getPlayer() != nullptr) 81 81 { 82 82 for (int i = 0; i < 7; i++) … … 96 96 InvaderShip* Invader::getPlayer() 97 97 { 98 if (player == NULL)98 if (player == nullptr) 99 99 { 100 100 for (ObjectList<InvaderShip>::iterator it = ObjectList<InvaderShip>::begin(); it != ObjectList<InvaderShip>::end(); ++it) … … 106 106 void Invader::spawnEnemy() 107 107 { 108 if (getPlayer() == NULL)108 if (getPlayer() == nullptr) 109 109 return; 110 110 … … 158 158 this->bForceSpawn_ = true; 159 159 160 if (this->center_ == NULL) // abandon mission!160 if (this->center_ == nullptr) // abandon mission! 161 161 { 162 162 orxout(internal_error) << "Invader: No Centerpoint specified." << endl; -
code/branches/cpp11_v2/src/modules/invader/InvaderCenterPoint.cc
r10624 r10765 56 56 void InvaderCenterPoint::checkGametype() 57 57 { 58 if (this->getGametype() != NULL&& this->getGametype()->isA(Class(Invader)))58 if (this->getGametype() != nullptr && this->getGametype()->isA(Class(Invader))) 59 59 { 60 60 Invader* InvaderGametype = orxonox_cast<Invader*>(this->getGametype()); -
code/branches/cpp11_v2/src/modules/invader/InvaderEnemy.cc
r10733 r10765 56 56 removeHealth(2000); 57 57 58 if (player != NULL)58 if (player != nullptr) 59 59 { 60 60 float newZ = 2/(pow(abs(getPosition().x - player->getPosition().x) * 0.01f, 2) + 1) * (player->getPosition().z - getPosition().z); … … 73 73 Invader* InvaderEnemy::getGame() 74 74 { 75 if (game == NULL)75 if (game == nullptr) 76 76 { 77 77 for (ObjectList<Invader>::iterator it = ObjectList<Invader>::begin(); it != ObjectList<Invader>::end(); ++it) … … 84 84 { 85 85 Pawn::damage(damage, healthdamage, shielddamage, originator, cs); 86 if (getGame() && orxonox_cast<InvaderShip*>(originator) != NULL&& getHealth() <= 0)86 if (getGame() && orxonox_cast<InvaderShip*>(originator) != nullptr && getHealth() <= 0) 87 87 getGame()->addPoints(42); 88 88 } -
code/branches/cpp11_v2/src/modules/invader/InvaderEnemyShooter.cc
r10733 r10765 59 59 removeHealth(2000); 60 60 61 if (player != NULL)61 if (player != nullptr) 62 62 { 63 63 float distPlayer = player->getPosition().z - getPosition().z; … … 77 77 { 78 78 Pawn::damage(damage, healthdamage, shielddamage, originator, cs); 79 if (getGame() && orxonox_cast<InvaderShip*>(originator) != NULL&& getHealth() <= 0)79 if (getGame() && orxonox_cast<InvaderShip*>(originator) != nullptr && getHealth() <= 0) 80 80 getGame()->addPoints(3*42); 81 81 } -
code/branches/cpp11_v2/src/modules/invader/InvaderShip.cc
r10733 r10765 95 95 // Camera 96 96 Camera* camera = this->getCamera(); 97 if (camera != NULL)97 if (camera != nullptr) 98 98 { 99 99 camera->setPosition(Vector3(-pos.z, -posforeward, 0)); … … 154 154 Projectile* shot = orxonox_cast<Projectile*>(otherObject); 155 155 // ensure that this gets only called once per enemy. 156 if (enemy != NULL&& lastEnemy != enemy)156 if (enemy != nullptr && lastEnemy != enemy) 157 157 { 158 158 lastEnemy = enemy; … … 165 165 } 166 166 // was shot, decrease multiplier 167 else if (shot != NULL&& lastShot != shot)167 else if (shot != nullptr && lastShot != shot) 168 168 { 169 if (getGame() && orxonox_cast<InvaderEnemy*>(shot->getShooter()) != NULL)169 if (getGame() && orxonox_cast<InvaderEnemy*>(shot->getShooter()) != nullptr) 170 170 { 171 171 if (getGame()->multiplier > 1) … … 182 182 Invader* InvaderShip::getGame() 183 183 { 184 if (game == NULL)184 if (game == nullptr) 185 185 { 186 186 for (ObjectList<Invader>::iterator it = ObjectList<Invader>::begin(); it != ObjectList<Invader>::end(); ++it) -
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(); -
code/branches/cpp11_v2/src/modules/mini4dgame/Mini4Dgame.cc
r10624 r10765 88 88 void Mini4Dgame::cleanup() 89 89 { 90 if(this->board_ != NULL)// Destroy the board, if present.90 if(this->board_ != nullptr)// Destroy the board, if present. 91 91 { 92 92 //this->board_->destroy(); … … 101 101 void Mini4Dgame::start() 102 102 { 103 if (this->board_ != NULL) // There needs to be a Mini4DgameCenterpoint, i.e. the area the game takes place.103 if (this->board_ != nullptr) // There needs to be a Mini4DgameCenterpoint, i.e. the area the game takes place. 104 104 { 105 105 /* 106 if (this->board_ == NULL)106 if (this->board_ == nullptr) 107 107 { 108 108 this->board_ = new Mini4DgameBoard(this->board_->getContext()); … … 174 174 assert(player); 175 175 176 if(false)//this->player_ == NULL)176 if(false)//this->player_ == nullptr) 177 177 { 178 178 //this->player_ = player; -
code/branches/cpp11_v2/src/modules/mini4dgame/Mini4DgameBoard.cc
r10624 r10765 905 905 void Mini4DgameBoard::checkGametype() 906 906 { 907 if (this->getGametype() != NULL&& this->getGametype()->isA(Class(Mini4Dgame)))907 if (this->getGametype() != nullptr && this->getGametype()->isA(Class(Mini4Dgame))) 908 908 { 909 909 Mini4Dgame* Mini4DgameGametype = orxonox_cast<Mini4Dgame*>(this->getGametype()); -
code/branches/cpp11_v2/src/modules/notifications/NotificationDispatcher.cc
r10624 r10765 177 177 178 178 PlayerTrigger* pTrigger = orxonox_cast<PlayerTrigger*>(trigger); 179 PlayerInfo* player = NULL;179 PlayerInfo* player = nullptr; 180 180 181 181 // If the trigger is a PlayerTrigger. 182 if(pTrigger != NULL)182 if(pTrigger != nullptr) 183 183 { 184 184 if(!pTrigger->isForPlayer()) // The PlayerTrigger is not exclusively for Pawns which means we cannot extract one. … … 190 190 return false; 191 191 192 if(player == NULL)192 if(player == nullptr) 193 193 { 194 194 orxout(verbose, context::notifications) << "The NotificationDispatcher was triggered by an entity other than a Pawn. (" << trigger->getIdentifier()->getName() << ")" << endl; -
code/branches/cpp11_v2/src/modules/notifications/NotificationManager.cc
r10624 r10765 334 334 // If all senders are the target of the NotificationQueue, then the list of Notifications for that specific NotificationQueue is the same as the list of all Notifications. 335 335 bool bAll = set.find(NotificationListener::ALL) != set.end(); 336 std::multimap<std::time_t, Notification*>* map = NULL;336 std::multimap<std::time_t, Notification*>* map = nullptr; 337 337 if(bAll) 338 338 this->notificationLists_[queue->getName()] = &this->allNotificationsList_; … … 395 395 The name of the NotificationQueue. 396 396 @return 397 Returns a pointer to the NotificationQueue with the input name. Returns NULLif no NotificationQueue with such a name exists.397 Returns a pointer to the NotificationQueue with the input name. Returns nullptr if no NotificationQueue with such a name exists. 398 398 */ 399 399 NotificationQueue* NotificationManager::getQueue(const std::string & name) 400 400 { 401 401 std::map<const std::string, NotificationQueue*>::iterator it = this->queues_.find(name); 402 // Returns NULLif no such NotificationQueue exists.402 // Returns nullptr if no such NotificationQueue exists. 403 403 if(it == this->queues_.end()) 404 return NULL;404 return nullptr; 405 405 406 406 return (*it).second; -
code/branches/cpp11_v2/src/modules/notifications/NotificationQueueCEGUI.cc
r10258 r10765 290 290 The name of the NotificationQueueCEGUI to be got. 291 291 @return 292 Returns a pointer to the NotificationQueueCEGUI, or NULLif it doesn't exist.292 Returns a pointer to the NotificationQueueCEGUI, or nullptr if it doesn't exist. 293 293 */ 294 294 /*static*/ NotificationQueueCEGUI* NotificationQueueCEGUI::getQueue(const std::string& name) 295 295 { 296 296 NotificationQueue* queue = NotificationManager::getInstance().getQueue(name); 297 if(queue == NULL|| !queue->isA(Class(NotificationQueueCEGUI)))298 return NULL;297 if(queue == nullptr || !queue->isA(Class(NotificationQueueCEGUI))) 298 return nullptr; 299 299 return static_cast<NotificationQueueCEGUI*>(queue); 300 300 } -
code/branches/cpp11_v2/src/modules/objects/Script.cc
r10624 r10765 140 140 141 141 PlayerTrigger* pTrigger = orxonox_cast<PlayerTrigger*>(trigger); 142 PlayerInfo* player = NULL;142 PlayerInfo* player = nullptr; 143 143 144 144 // If the trigger is a PlayerTrigger. 145 if(pTrigger != NULL)145 if(pTrigger != nullptr) 146 146 { 147 147 if(!pTrigger->isForPlayer()) // The PlayerTrigger is not exclusively for Pawns which means we cannot extract one. … … 153 153 return false; 154 154 155 if(player == NULL) //TODO: Will this ever happen? If not, change in NotificationDispatcher as well.155 if(player == nullptr) //TODO: Will this ever happen? If not, change in NotificationDispatcher as well. 156 156 { 157 157 orxout(internal_warning) << "The Script was triggered by an entity other than a Pawn. (" << trigger->getIdentifier()->getName() << ")" << endl; -
code/branches/cpp11_v2/src/modules/objects/SpaceBoundaries.cc
r10624 r10765 61 61 for( std::vector<BillboardAdministration>::iterator current = this->billboards_.begin(); current != this->billboards_.end(); current++) 62 62 { 63 if( current->billy != NULL)63 if( current->billy != nullptr) 64 64 { 65 65 delete current->billy; … … 127 127 void SpaceBoundaries::setBillboardOptions(Billboard *billy) 128 128 { 129 if(billy != NULL)129 if(billy != nullptr) 130 130 { 131 131 billy->setMaterial("Grid"); … … 250 250 float SpaceBoundaries::computeDistance(WorldEntity *item) 251 251 { 252 if(item != NULL)252 if(item != nullptr) 253 253 { 254 254 Vector3 itemPosition = item->getWorldPosition(); … … 310 310 bool SpaceBoundaries::isHumanPlayer(Pawn *item) 311 311 { 312 if(item != NULL)312 if(item != nullptr) 313 313 { 314 314 if(item->getPlayer()) -
code/branches/cpp11_v2/src/modules/objects/triggers/DistanceMultiTrigger.cc
r10624 r10765 97 97 { 98 98 99 std::queue<MultiTriggerState*>* queue = NULL;99 std::queue<MultiTriggerState*>* queue = nullptr; 100 100 101 101 // Check for objects that were in range but no longer are. Iterate through all objects, that are in range. … … 105 105 106 106 // If the entity no longer exists. 107 if(entity == NULL)107 if(entity == nullptr) 108 108 { 109 109 this->range_.erase(it++); … … 118 118 119 119 // If no queue has been created, yet. 120 if(queue == NULL)120 if(queue == nullptr) 121 121 queue = new std::queue<MultiTriggerState*>(); 122 122 … … 186 186 187 187 // If no queue has been created, yet. 188 if(queue == NULL)188 if(queue == nullptr) 189 189 queue = new std::queue<MultiTriggerState*>(); 190 190 -
code/branches/cpp11_v2/src/modules/objects/triggers/DistanceTrigger.cc
r10624 r10765 106 106 this->setForPlayer(true); 107 107 108 if (targetId == NULL)108 if (targetId == nullptr) 109 109 { 110 110 orxout(internal_error, context::triggers) << "\"" << targetStr << "\" is not a valid class name to include in ClassTreeMask (in " << this->getName() << ", class " << this->getIdentifier()->getName() << ')' << endl; … … 147 147 { 148 148 // Check whether there is a cached object, it still exists and whether it is still in range, if so nothing further needs to be done. 149 if(this->cache_ != NULL)149 if(this->cache_ != nullptr) 150 150 { 151 151 if((this->cache_->getWorldPosition() - this->getWorldPosition()).length() < this->distance_) … … 206 206 207 207 Pawn* pawn = orxonox_cast<Pawn*>(entity); 208 if(pawn != NULL)208 if(pawn != nullptr) 209 209 this->setTriggeringPawn(pawn); 210 210 else 211 orxout(internal_warning, context::triggers) << "Pawn was NULL." << endl;211 orxout(internal_warning, context::triggers) << "Pawn was nullptr." << endl; 212 212 } 213 213 -
code/branches/cpp11_v2/src/modules/objects/triggers/EventMultiTrigger.cc
r9667 r10765 96 96 { 97 97 // If the originator is a MultiTriggerContainer, the event originates from a MultiTrigger and thus the event only triggers the EventMultiTrigger for the originator that caused the MultiTrigger to trigger. 98 if(originator != NULL&& originator->isA(ClassIdentifier<MultiTriggerContainer>::getIdentifier()))98 if(originator != nullptr && originator->isA(ClassIdentifier<MultiTriggerContainer>::getIdentifier())) 99 99 { 100 100 MultiTriggerContainer* container = static_cast<MultiTriggerContainer*>(originator); -
code/branches/cpp11_v2/src/modules/objects/triggers/MultiTrigger.cc
r9667 r10765 124 124 // Let the MultiTrigger return the states that trigger and process the new states if there are any. 125 125 std::queue<MultiTriggerState*>* queue = this->letTrigger(); 126 if(queue != NULL)126 if(queue != nullptr) 127 127 { 128 128 while(queue->size() > 0) 129 129 { 130 130 MultiTriggerState* state = queue->front(); 131 // If the state is NULL. (This really shouldn't happen)132 if(state == NULL)131 // If the state is nullptr. (This really shouldn't happen) 132 if(state == nullptr) 133 133 { 134 orxout(internal_error, context::triggers) << "In MultiTrigger '" << this->getName() << "' (&" << this << "), Error: State of new states queue was NULL. State ignored." << endl;134 orxout(internal_error, context::triggers) << "In MultiTrigger '" << this->getName() << "' (&" << this << "), Error: State of new states queue was nullptr. State ignored." << endl; 135 135 queue->pop(); 136 136 continue; … … 227 227 { 228 228 // If the MultiTrigger is set to broadcast and has no originator a boradcast is fired. 229 if(this->getBroadcast() && state->originator == NULL)229 if(this->getBroadcast() && state->originator == nullptr) 230 230 this->broadcast(bActive); 231 231 // Else a normal event is fired. … … 240 240 { 241 241 // Print some debug output if the state has changed. 242 if(state->originator != NULL)242 if(state->originator != nullptr) 243 243 orxout(verbose, context::triggers) << "MultiTrigger '" << this->getName() << "' (&" << this << ") changed state. originator: " << state->originator->getIdentifier()->getName() << " (&" << state->originator << "), active: " << bActive << ", triggered: " << state->bTriggered << "." << endl; 244 244 else 245 orxout(verbose, context::triggers) << "MultiTrigger '" << this->getName() << "' (&" << this << ") changed state. originator: NULL, active: " << bActive << ", triggered: " << state->bTriggered << "." << endl;245 orxout(verbose, context::triggers) << "MultiTrigger '" << this->getName() << "' (&" << this << ") changed state. originator: nullptr, active: " << bActive << ", triggered: " << state->bTriggered << "." << endl; 246 246 247 247 // If the MultiTrigger has a parent trigger, that is itself a MultiTrigger, it needs to call a method to notify him, that its activity has changed. 248 if(this->parent_ != NULL&& this->parent_->isMultiTrigger())248 if(this->parent_ != nullptr && this->parent_->isMultiTrigger()) 249 249 static_cast<MultiTrigger*>(this->parent_)->childActivityChanged(state->originator); 250 250 } … … 299 299 300 300 // If the target is not a valid class name display an error. 301 if (target == NULL)301 if (target == nullptr) 302 302 { 303 303 orxout(internal_error, context::triggers) << "'" << targetStr << "' is not a valid class name to include in ClassTreeMask (in " << this->getName() << ", class " << this->getIdentifier()->getName() << ")" << endl; … … 327 327 328 328 // If the target is not a valid class name display an error. 329 if (target == NULL)329 if (target == nullptr) 330 330 { 331 331 orxout(internal_error, context::triggers) << "'" << targetStr << "' is not a valid class name to include in ClassTreeMask (in " << this->getName() << ", class " << this->getIdentifier()->getName() << ")" << endl; … … 346 346 std::queue<MultiTriggerState*>* MultiTrigger::letTrigger(void) 347 347 { 348 return NULL;348 return nullptr; 349 349 } 350 350 … … 443 443 void MultiTrigger::fire(bool status, BaseObject* originator) 444 444 { 445 // If the originator is NULL, a normal event without MultiTriggerContainer is sent.446 if(originator == NULL)445 // If the originator is nullptr, a normal event without MultiTriggerContainer is sent. 446 if(originator == nullptr) 447 447 { 448 448 this->fireEvent(status); … … 479 479 bool MultiTrigger::addState(MultiTriggerState* state) 480 480 { 481 assert(state); // The state really shouldn't be NULL.481 assert(state); // The state really shouldn't be nullptr. 482 482 483 483 // If the originator is no target of this MultiTrigger. -
code/branches/cpp11_v2/src/modules/objects/triggers/MultiTrigger.h
r9667 r10765 76 76 - @b simultaneousTriggerers The number of simultaneous triggerers limits the number of objects that are allowed to trigger the MultiTrigger at the same time. Or more precisely, the number of distinct objects the MultiTrigger has <em>triggered</em> states for, at each point in time. The default is <code>-1</code>, which denotes infinity. 77 77 - @b mode The mode describes how the MultiTrigger acts in relation to all the triggers, that are appended to it. There are 3 modes: <em>and</em>, meaning that the MultiTrigger can only be triggered if all the appended triggers are active. <em>or</em>, meaning that the MultiTrigger can only triggered if at least one of the appended triggers is active. And <em>xor</em>, meaning that the MultiTrigger can only be triggered if one and only one appended trigger is active. Note, that I wrote <em>can only be active</em>, that implies, that there is an additional condition to the <em>activity</em> of the MultiTrigger and that is the fulfillment of the triggering condition (the MultiTrigger itself doesn't have one, but all derived classes should). Also bear in mind, that the <em>activity</em> of a MultiTrigger is still coupled to the object that triggered it. The default is <em>and</em>. 78 - @b broadcast Broadcast is a boolean, if true the MutliTrigger is in <em>broadcast-mode</em>, meaning, that all trigger events that are caused by no originator (originator is NULL) are broadcast as having come from every possible originator, or more precisely as having come from all objects that are specified targets of this MultiTrigger. The default is false.78 - @b broadcast Broadcast is a boolean, if true the MutliTrigger is in <em>broadcast-mode</em>, meaning, that all trigger events that are caused by no originator (originator is nullptr) are broadcast as having come from every possible originator, or more precisely as having come from all objects that are specified targets of this MultiTrigger. The default is false. 79 79 - @b target The target describes the kind of objects that are allowed to trigger this MultiTrigger. The default is @ref orxonox::Pawn "Pawn". 80 80 - Also there is the possibility of appending triggers (as long as they inherit from TriggerBase) to the MultiTrigger just by adding them as children in the XML description of your MultiTrigger. … … 110 110 */ 111 111 inline bool isActive(void) const 112 { return this->isActive( NULL); }113 bool isActive(BaseObject* triggerer = NULL) const; //!< Check whether the MultiTrigger is active for a given object.112 { return this->isActive(nullptr); } 113 bool isActive(BaseObject* triggerer = nullptr) const; //!< Check whether the MultiTrigger is active for a given object. 114 114 115 115 /** … … 145 145 */ 146 146 inline bool isTarget(BaseObject* target) 147 { if(target == NULL) return true; else return targetMask_.isIncluded(target->getIdentifier()); }147 { if(target == nullptr) return true; else return targetMask_.isIncluded(target->getIdentifier()); } 148 148 149 149 void addTarget(const std::string& targets); //!< Add some target to the MultiTrigger. … … 152 152 virtual std::queue<MultiTriggerState*>* letTrigger(void); //!< This method is called by the MultiTrigger to get information about new trigger events that need to be looked at. 153 153 154 void changeTriggered(BaseObject* originator = NULL); //!< This method can be called by any class inheriting from MultiTrigger to change it's triggered status for a specified originator.155 156 bool isModeTriggered(BaseObject* triggerer = NULL); //!< Checks whether the MultiTrigger is triggered concerning it's children.157 bool isTriggered(BaseObject* triggerer = NULL); //!< Get whether the MultiTrigger is triggered for a given object.158 159 virtual void fire(bool status, BaseObject* originator = NULL); //!< Helper method. Creates an Event for the given status and originator and fires it.154 void changeTriggered(BaseObject* originator = nullptr); //!< This method can be called by any class inheriting from MultiTrigger to change it's triggered status for a specified originator. 155 156 bool isModeTriggered(BaseObject* triggerer = nullptr); //!< Checks whether the MultiTrigger is triggered concerning it's children. 157 bool isTriggered(BaseObject* triggerer = nullptr); //!< Get whether the MultiTrigger is triggered for a given object. 158 159 virtual void fire(bool status, BaseObject* originator = nullptr); //!< Helper method. Creates an Event for the given status and originator and fires it. 160 160 void broadcast(bool status); //!< Helper method. Broadcasts an Event for every object that is a target. 161 161 -
code/branches/cpp11_v2/src/modules/objects/triggers/MultiTriggerContainer.cc
r9667 r10765 50 50 The creator. 51 51 */ 52 MultiTriggerContainer::MultiTriggerContainer(Context* context) : BaseObject(context), originator_( NULL), data_(NULL)52 MultiTriggerContainer::MultiTriggerContainer(Context* context) : BaseObject(context), originator_(nullptr), data_(nullptr) 53 53 { 54 54 RegisterObject(MultiTriggerContainer); … … 70 70 71 71 Pawn* pawn = orxonox_cast<Pawn*>(data); 72 if(pawn != NULL)72 if(pawn != nullptr) 73 73 { 74 74 this->setForPlayer(true); -
code/branches/cpp11_v2/src/modules/objects/triggers/TriggerBase.cc
r9667 r10765 67 67 this->mode_ = TriggerMode::EventTriggerAND; 68 68 69 this->parent_ = NULL;69 this->parent_ = nullptr; 70 70 71 71 this->bMultiTrigger_ = false; … … 170 170 The index. 171 171 @return 172 Returns a pointer ot the trigger. NULLif no such trigger exists.172 Returns a pointer ot the trigger. nullptr if no such trigger exists. 173 173 */ 174 174 const TriggerBase* TriggerBase::getTrigger(unsigned int index) const … … 176 176 // If the index is greater than the number of children. 177 177 if (this->children_.size() <= index) 178 return NULL;178 return nullptr; 179 179 180 180 std::set<TriggerBase*>::const_iterator it; -
code/branches/cpp11_v2/src/modules/overlays/GUIOverlay.cc
r9667 r10765 92 92 ControllableEntity* entity = orxonox_cast<ControllableEntity*>(this->getOwner()); 93 93 if (entity) 94 GUIManager::getInstance().setPlayer(name, entity->getPlayer()); //Set Player is going to be NULL, so it needs to be set in changedVisibility() as well.94 GUIManager::getInstance().setPlayer(name, entity->getPlayer()); //Set Player is going to be nullptr, so it needs to be set in changedVisibility() as well. 95 95 } 96 96 } -
code/branches/cpp11_v2/src/modules/overlays/hud/HUDEnemyHealthBar.cc
r9667 r10765 62 62 void HUDEnemyHealthBar::updateTarget() 63 63 { 64 Pawn* pawn = NULL;64 Pawn* pawn = nullptr; 65 65 if (this->owner_ && this->useEnemyBar_) 66 66 { … … 73 73 // Don't show the HealthBar if the pawn is invisible 74 74 if (pawn && !pawn->isVisible()) 75 pawn = NULL;75 pawn = nullptr; 76 76 } 77 77 // Set the pawn as owner of the HealthBar 78 78 this->setHealthBarOwner(pawn); 79 this->setVisible(pawn != NULL);79 this->setVisible(pawn != nullptr); 80 80 } 81 81 -
code/branches/cpp11_v2/src/modules/overlays/hud/HUDNavigation.cc
r10624 r10765 134 134 for (std::map<RadarViewable*, ObjectInfo>::iterator it = this->activeObjectList_.begin(); it != this->activeObjectList_.end(); ++it) 135 135 { 136 if (it->second.text_ != NULL)136 if (it->second.text_ != nullptr) 137 137 it->second.text_->setFontName(this->fontName_); 138 138 } … … 183 183 184 184 Camera* cam = CameraManager::getInstance().getActiveCamera(); 185 if (cam == NULL)185 if (cam == nullptr) 186 186 return; 187 187 const Matrix4& camTransform = cam->getOgreCamera()->getProjectionMatrix() * cam->getOgreCamera()->getViewMatrix(); … … 476 476 if(!it->second.selected_ 477 477 || it->first->getRVVelocity().squaredLength() == 0 478 || pawn == NULL478 || pawn == nullptr 479 479 /* TODO : improve getTeam in such a way that it works 480 * || humanPawn == NULL480 * || humanPawn == nullptr 481 481 * || pawn->getTeam() == humanPawn->getTeam()*/) 482 482 { … … 534 534 for (std::map<RadarViewable*, ObjectInfo>::iterator it = this->activeObjectList_.begin(); it != this->activeObjectList_.end(); ++it) 535 535 { 536 if (it->second.health_ != NULL)536 if (it->second.health_ != nullptr) 537 537 it->second.health_->setDimensions(this->healthMarkerSize_ * xScale, this->healthMarkerSize_ * yScale); 538 if (it->second.healthLevel_ != NULL)538 if (it->second.healthLevel_ != nullptr) 539 539 it->second.healthLevel_->setDimensions(this->healthLevelMarkerSize_ * xScale, this->healthLevelMarkerSize_ * yScale); 540 if (it->second.panel_ != NULL)540 if (it->second.panel_ != nullptr) 541 541 it->second.panel_->setDimensions(this->navMarkerSize_ * xScale, this->navMarkerSize_ * yScale); 542 if (it->second.text_ != NULL)542 if (it->second.text_ != nullptr) 543 543 it->second.text_->setCharHeight(this->textSize_ * yScale); 544 if (it->second.target_ != NULL)544 if (it->second.target_ != nullptr) 545 545 it->second.target_->setDimensions(this->aimMarkerSize_ * xScale, this->aimMarkerSize_ * yScale); 546 546 } … … 553 553 554 554 if (this->activeObjectList_.size() >= this->markerLimit_) 555 if (object == NULL)555 if (object == nullptr) 556 556 return; 557 557 -
code/branches/cpp11_v2/src/modules/pickup/CollectiblePickup.cc
r10624 r10765 47 47 Registers the object and initializes variables. 48 48 */ 49 CollectiblePickup::CollectiblePickup() : collection_( NULL)49 CollectiblePickup::CollectiblePickup() : collection_(nullptr) 50 50 { 51 51 RegisterObject(CollectiblePickup); … … 103 103 void CollectiblePickup::wasRemovedFromCollection(void) 104 104 { 105 this->collection_ = NULL;105 this->collection_ = nullptr; 106 106 } 107 107 } -
code/branches/cpp11_v2/src/modules/pickup/CollectiblePickup.h
r9348 r10765 69 69 */ 70 70 bool isInCollection(void) const 71 { return this->collection_ != NULL; }71 { return this->collection_ != nullptr; } 72 72 73 73 private: -
code/branches/cpp11_v2/src/modules/pickup/PickupCollection.cc
r9667 r10765 148 148 for(std::list<CollectiblePickup*>::iterator it = this->pickups_.begin(); it != this->pickups_.end(); ++it) 149 149 { 150 if(this->getCarrier() == NULL)151 (*it)->setCarrier( NULL);150 if(this->getCarrier() == nullptr) 151 (*it)->setCarrier(nullptr); 152 152 else 153 153 (*it)->setCarrier(this->getCarrier()->getTarget(*it)); … … 227 227 bool PickupCollection::addPickupable(CollectiblePickup* pickup) 228 228 { 229 if(pickup == NULL)229 if(pickup == nullptr) 230 230 return false; 231 231 … … 247 247 { 248 248 if(this->pickups_.size() >= index) 249 return NULL;249 return nullptr; 250 250 251 251 std::list<CollectiblePickup*>::const_iterator it = this->pickups_.begin(); -
code/branches/cpp11_v2/src/modules/pickup/PickupManager.cc
r10624 r10765 68 68 Constructor. Registers the PickupManager and creates the default PickupRepresentation. 69 69 */ 70 PickupManager::PickupManager() : guiLoaded_(false), pickupHighestIndex_(0), defaultRepresentation_( NULL)70 PickupManager::PickupManager() : guiLoaded_(false), pickupHighestIndex_(0), defaultRepresentation_(nullptr) 71 71 { 72 72 RegisterObject(PickupManager); … … 85 85 { 86 86 // Destroying the default representation. 87 if(this->defaultRepresentation_ != NULL)87 if(this->defaultRepresentation_ != nullptr) 88 88 this->defaultRepresentation_->destroy(); 89 89 … … 184 184 CollectiblePickup* collectible = orxonox_cast<CollectiblePickup*>(pickup); 185 185 // If the Pickupable is part of a PickupCollection it isn't displayed in the PickupInventory, just the PickupCollection is. 186 if(collectible != NULL&& collectible->isInCollection())186 if(collectible != nullptr && collectible->isInCollection()) 187 187 return; 188 188 189 189 // Getting clientId of the host this change of the pickup's used status concerns. 190 190 PickupCarrier* carrier = pickup->getCarrier(); 191 while(carrier->getCarrierParent() != NULL)191 while(carrier->getCarrierParent() != nullptr) 192 192 carrier = carrier->getCarrierParent(); 193 193 Pawn* pawn = orxonox_cast<Pawn*>(carrier); 194 if(pawn == NULL)194 if(pawn == nullptr) 195 195 return; 196 196 PlayerInfo* info = pawn->getPlayer(); 197 if(info == NULL)197 if(info == nullptr) 198 198 return; 199 199 unsigned int clientId = info->getClientID(); … … 265 265 CollectiblePickup* collectible = orxonox_cast<CollectiblePickup*>(pickup); 266 266 // If the Pickupable is part of a PickupCollection it isn't displayed in the PickupInventory, just the PickupCollection is. 267 if(collectible != NULL&& collectible->isInCollection())267 if(collectible != nullptr && collectible->isInCollection()) 268 268 return; 269 269 270 270 // Getting clientId of the host this change of the pickup's pickedUp status concerns. 271 271 PickupCarrier* carrier = pickup->getCarrier(); 272 while(carrier->getCarrierParent() != NULL)272 while(carrier->getCarrierParent() != nullptr) 273 273 carrier = carrier->getCarrierParent(); 274 274 Pawn* pawn = orxonox_cast<Pawn*>(carrier); 275 if(pawn == NULL)275 if(pawn == nullptr) 276 276 return; 277 277 PlayerInfo* info = pawn->getFormerPlayer(); 278 if(info == NULL)278 if(info == nullptr) 279 279 return; 280 280 unsigned int clientId = info->getClientID(); … … 399 399 return; 400 400 Pickupable* pickupable = this->pickups_.find(pickup)->second; 401 if(pickupable != NULL)401 if(pickupable != nullptr) 402 402 pickupable->drop(); 403 403 } … … 442 442 return; 443 443 Pickupable* pickupable = this->pickups_.find(pickup)->second; 444 if(pickupable != NULL)444 if(pickupable != nullptr) 445 445 pickupable->setUsed(use); 446 446 } -
code/branches/cpp11_v2/src/modules/pickup/PickupRepresentation.cc
r9667 r10765 52 52 This is primarily for use of the PickupManager in creating a default PickupRepresentation. 53 53 */ 54 PickupRepresentation::PickupRepresentation() : BaseObject( NULL), Synchronisable(NULL), spawnerRepresentation_(NULL)54 PickupRepresentation::PickupRepresentation() : BaseObject(nullptr), Synchronisable(nullptr), spawnerRepresentation_(nullptr) 55 55 { 56 56 RegisterObject(PickupRepresentation); … … 64 64 Default Constructor. Registers the object and initializes its member variables. 65 65 */ 66 PickupRepresentation::PickupRepresentation(Context* context) : BaseObject(context), Synchronisable(context), spawnerRepresentation_( NULL)66 PickupRepresentation::PickupRepresentation(Context* context) : BaseObject(context), Synchronisable(context), spawnerRepresentation_(nullptr) 67 67 { 68 68 RegisterObject(PickupRepresentation); … … 78 78 PickupRepresentation::~PickupRepresentation() 79 79 { 80 if(this->spawnerRepresentation_ != NULL)80 if(this->spawnerRepresentation_ != nullptr) 81 81 this->spawnerRepresentation_->destroy(); 82 82 … … 135 135 StaticEntity* PickupRepresentation::createSpawnerRepresentation(PickupSpawner* spawner) 136 136 { 137 if(this->spawnerRepresentation_ == NULL)137 if(this->spawnerRepresentation_ == nullptr) 138 138 { 139 139 orxout(verbose, context::pickups) << "PickupRepresentation: No spawner representation found." << endl; … … 149 149 this->spawnerRepresentation_->setVisible(true); 150 150 StaticEntity* temp = this->spawnerRepresentation_; 151 this->spawnerRepresentation_ = NULL;151 this->spawnerRepresentation_ = nullptr; 152 152 153 153 return temp; … … 164 164 { 165 165 this->spawnerRepresentation_ = representation; 166 if(this->spawnerRepresentation_ != NULL)166 if(this->spawnerRepresentation_ != nullptr) 167 167 this->spawnerRepresentation_->setVisible(false); 168 168 } -
code/branches/cpp11_v2/src/modules/pickup/PickupRepresentation.h
r9667 r10765 119 119 @brief Get the StaticEntity that defines how the PickupSpawner of the Pickupable represented by this PickupRepresentation looks like. 120 120 @param index The index. 121 @return Returns (for index = 0) a pointer to the StaticEntity. For index > 0 it returns NULL.121 @return Returns (for index = 0) a pointer to the StaticEntity. For index > 0 it returns nullptr. 122 122 */ 123 123 inline const StaticEntity* getSpawnerRepresentationIndex(unsigned int index) const 124 { if(index == 0) return this->spawnerRepresentation_; return NULL; }124 { if(index == 0) return this->spawnerRepresentation_; return nullptr; } 125 125 /** 126 126 @brief Get the name of the image representing the pickup in the PickupInventory. -
code/branches/cpp11_v2/src/modules/pickup/PickupSpawner.cc
r10624 r10765 55 55 Pointer to the object which created this item. 56 56 */ 57 PickupSpawner::PickupSpawner(Context* context) : StaticEntity(context), pickup_( NULL), representation_(NULL), pickupTemplate_(NULL)57 PickupSpawner::PickupSpawner(Context* context) : StaticEntity(context), pickup_(nullptr), representation_(nullptr), pickupTemplate_(nullptr) 58 58 { 59 59 RegisterObject(PickupSpawner); … … 74 74 this->selfDestruct_ = false; 75 75 76 this->setPickupable( NULL);76 this->setPickupable(nullptr); 77 77 } 78 78 … … 83 83 PickupSpawner::~PickupSpawner() 84 84 { 85 if(this->isInitialized() && this->selfDestruct_ && this->pickup_ != NULL)85 if(this->isInitialized() && this->selfDestruct_ && this->pickup_ != nullptr) 86 86 this->pickup_->destroy(); 87 87 } … … 160 160 for(ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it != ObjectList<Pawn>::end(); ++it) 161 161 { 162 if(spawner == NULL) // Stop if the PickupSpawner has been deleted (e.g. because it has run out of pickups to distribute).162 if(spawner == nullptr) // Stop if the PickupSpawner has been deleted (e.g. because it has run out of pickups to distribute). 163 163 break; 164 164 … … 166 166 PickupCarrier* carrier = static_cast<PickupCarrier*>(*it); 167 167 // If a PickupCarrier, that fits the target-range of the Pickupable spawned by this PickupSpawner, is in trigger-distance and the carrier is not blocked. 168 if(distance.length() < this->triggerDistance_ && carrier != NULL&& this->blocked_.find(carrier) == this->blocked_.end())168 if(distance.length() < this->triggerDistance_ && carrier != nullptr && this->blocked_.find(carrier) == this->blocked_.end()) 169 169 { 170 170 if(carrier->isTarget(this->pickup_)) … … 195 195 pickedUp = false; // To avoid compiler warning. 196 196 197 this->setPickupable( NULL);197 this->setPickupable(nullptr); 198 198 this->decrementSpawnsRemaining(); 199 199 } … … 282 282 { 283 283 orxout(internal_error, context::pickups) << "Massive Error: PickupSpawner still alive until having spawned last item." << endl; 284 return NULL;285 } 286 287 if (this->pickupTemplate_ != NULL)284 return nullptr; 285 } 286 287 if (this->pickupTemplate_ != nullptr) 288 288 { 289 289 Identifier* identifier = this->pickupTemplate_->getBaseclassIdentifier(); 290 if (identifier != NULL)290 if (identifier != nullptr) 291 291 { 292 292 Pickupable* pickup = orxonox_cast<Pickupable*>(identifier->fabricate(this->getContext())); … … 298 298 } 299 299 300 return NULL;300 return nullptr; 301 301 } 302 302 … … 309 309 void PickupSpawner::setPickupable(Pickupable* pickup) 310 310 { 311 if (this->representation_ != NULL)311 if (this->representation_ != nullptr) 312 312 { 313 313 this->representation_->destroy(); 314 this->representation_ = NULL;315 } 316 317 if (pickup != NULL)318 { 319 if (this->pickup_ != NULL)314 this->representation_ = nullptr; 315 } 316 317 if (pickup != nullptr) 318 { 319 if (this->pickup_ != nullptr) 320 320 this->pickup_->destroy(); 321 321 -
code/branches/cpp11_v2/src/modules/pickup/items/DamageBoostPickup.cc
r9667 r10765 106 106 107 107 SpaceShip* ship = this->carrierToSpaceShipHelper(); 108 if(ship == NULL) // If the PickupCarrier is no SpaceShip, then this pickup is useless and therefore is destroyed.108 if(ship == nullptr) // If the PickupCarrier is no SpaceShip, then this pickup is useless and therefore is destroyed. 109 109 this->Pickupable::destroy(); 110 110 … … 152 152 Helper to transform the PickupCarrier to a SpaceShip, and throw an error message if the conversion fails. 153 153 @return 154 A pointer to the SpaceShip, or NULLif the conversion failed.154 A pointer to the SpaceShip, or nullptr if the conversion failed. 155 155 */ 156 156 SpaceShip* DamageBoostPickup::carrierToSpaceShipHelper(void) … … 159 159 SpaceShip* ship = orxonox_cast<SpaceShip*>(carrier); 160 160 161 if(ship == NULL)161 if(ship == nullptr) 162 162 { 163 163 orxout(internal_error, context::pickups) << "Invalid PickupCarrier in DamageBoostPickup." << endl; -
code/branches/cpp11_v2/src/modules/pickup/items/DronePickup.cc
r9667 r10765 122 122 123 123 Pawn* pawn = this->carrierToPawnHelper(); 124 if(pawn == NULL) // If the PickupCarrier is no Pawn, then this pickup is useless and therefore is destroyed.124 if(pawn == nullptr) // If the PickupCarrier is no Pawn, then this pickup is useless and therefore is destroyed. 125 125 this->Pickupable::destroy(); 126 126 … … 131 131 Controller* controller = drone->getController(); 132 132 DroneController* droneController = orxonox_cast<DroneController*>(controller); 133 if(droneController != NULL)133 if(droneController != nullptr) 134 134 { 135 135 droneController->setOwner(pawn); … … 156 156 Helper to transform the PickupCarrier to a Pawn, and throw an error message if the conversion fails. 157 157 @return 158 A pointer to the Pawn, or NULLif the conversion failed.158 A pointer to the Pawn, or nullptr if the conversion failed. 159 159 */ 160 160 Pawn* DronePickup::carrierToPawnHelper(void) … … 163 163 Pawn* pawn = orxonox_cast<Pawn*>(carrier); 164 164 165 if(pawn == NULL)165 if(pawn == nullptr) 166 166 { 167 167 orxout(internal_error, context::pickups) << "Invalid PickupCarrier in DronePickup." << endl; -
code/branches/cpp11_v2/src/modules/pickup/items/HealthPickup.cc
r9667 r10765 114 114 { 115 115 Pawn* pawn = this->carrierToPawnHelper(); 116 if(pawn == NULL) // If the PickupCarrier is no Pawn, then this pickup is useless and therefore is destroyed.116 if(pawn == nullptr) // If the PickupCarrier is no Pawn, then this pickup is useless and therefore is destroyed. 117 117 this->Pickupable::destroy(); 118 118 … … 168 168 { 169 169 Pawn* pawn = this->carrierToPawnHelper(); 170 if(pawn == NULL) // If the PickupCarrier is no Pawn, then this pickup is useless and therefore is destroyed.170 if(pawn == nullptr) // If the PickupCarrier is no Pawn, then this pickup is useless and therefore is destroyed. 171 171 this->Pickupable::destroy(); 172 172 … … 206 206 Pawn* pawn = orxonox_cast<Pawn*>(carrier); 207 207 208 if(pawn == NULL)208 if(pawn == nullptr) 209 209 { 210 210 orxout(internal_error, context::pickups) << "Something went horribly wrong in Health Pickup. PickupCarrier is '" << carrier->getIdentifier()->getName() << "' instead of Pawn." << endl; … … 233 233 Helper to transform the PickupCarrier to a Pawn, and throw an error message if the conversion fails. 234 234 @return 235 A pointer to the Pawn, or NULLif the conversion failed.235 A pointer to the Pawn, or nullptr if the conversion failed. 236 236 */ 237 237 Pawn* HealthPickup::carrierToPawnHelper(void) … … 240 240 Pawn* pawn = orxonox_cast<Pawn*>(carrier); 241 241 242 if(pawn == NULL)242 if(pawn == nullptr) 243 243 orxout(internal_error, context::pickups) << "Invalid PickupCarrier in HealthPickup." << endl; 244 244 -
code/branches/cpp11_v2/src/modules/pickup/items/InvisiblePickup.cc
r9667 r10765 139 139 { 140 140 Pawn* pawn = this->carrierToPawnHelper(); 141 if(pawn == NULL)141 if(pawn == nullptr) 142 142 return false; 143 143 … … 163 163 Helper to transform the PickupCarrier to a Pawn, and throw an error message if the conversion fails. 164 164 @return 165 A pointer to the Pawn, or NULLif the conversion failed.165 A pointer to the Pawn, or nullptr if the conversion failed. 166 166 */ 167 167 Pawn* InvisiblePickup::carrierToPawnHelper(void) … … 170 170 Pawn* pawn = orxonox_cast<Pawn*>(carrier); 171 171 172 if(pawn == NULL)172 if(pawn == nullptr) 173 173 { 174 174 orxout(internal_error, context::pickups) << "Invalid PickupCarrier in InvisiblePickup." << endl; -
code/branches/cpp11_v2/src/modules/pickup/items/MetaPickup.cc
r9667 r10765 107 107 { 108 108 PickupCarrier* carrier = this->getCarrier(); 109 if(this->getMetaType() != pickupMetaType::none && carrier != NULL)109 if(this->getMetaType() != pickupMetaType::none && carrier != nullptr) 110 110 { 111 111 // If the metaType is destroyCarrier, then the PickupCarrier is destroyed. … … 121 121 { 122 122 Pickupable* pickup = (*it); 123 if(pickup == NULL|| pickup == this)123 if(pickup == nullptr || pickup == this) 124 124 continue; 125 125 -
code/branches/cpp11_v2/src/modules/pickup/items/ShieldPickup.cc
r9667 r10765 99 99 100 100 Pawn* pawn = this->carrierToPawnHelper(); 101 if(pawn == NULL)101 if(pawn == nullptr) 102 102 this->Pickupable::destroy(); 103 103 … … 143 143 Helper to transform the PickupCarrier to a Pawn, and throw an error message if the conversion fails. 144 144 @return 145 A pointer to the Pawn, or NULLif the conversion failed.145 A pointer to the Pawn, or nullptr if the conversion failed. 146 146 */ 147 147 Pawn* ShieldPickup::carrierToPawnHelper(void) … … 150 150 Pawn* pawn = orxonox_cast<Pawn*>(carrier); 151 151 152 if(pawn == NULL)152 if(pawn == nullptr) 153 153 { 154 154 orxout(internal_error, context::pickups) << "Invalid PickupCarrier in ShieldPickup." << endl; -
code/branches/cpp11_v2/src/modules/pickup/items/ShrinkPickup.cc
r10624 r10765 146 146 { 147 147 Pawn* pawn = this->carrierToPawnHelper(); 148 if(pawn == NULL) // If the PickupCarrier is no Pawn, then this pickup is useless and therefore is destroyed.148 if(pawn == nullptr) // If the PickupCarrier is no Pawn, then this pickup is useless and therefore is destroyed. 149 149 { 150 150 this->Pickupable::destroy(); … … 173 173 //TODO: Deploy particle effect. 174 174 Pawn* pawn = this->carrierToPawnHelper(); 175 if(pawn == NULL) // If the PickupCarrier is no Pawn, then this pickup is useless and therefore is destroyed.175 if(pawn == nullptr) // If the PickupCarrier is no Pawn, then this pickup is useless and therefore is destroyed. 176 176 return; 177 177 … … 187 187 { 188 188 CameraPosition* cameraPos = pawn->getCameraPosition(index); 189 if(cameraPos == NULL)189 if(cameraPos == nullptr) 190 190 continue; 191 191 cameraPos->setPosition(cameraPos->getPosition()/factor); … … 201 201 //TODO: Deploy particle effect. 202 202 Pawn* pawn = this->carrierToPawnHelper(); 203 if(pawn == NULL) // If the PickupCarrier is no Pawn, then this pickup is useless and therefore is destroyed.203 if(pawn == nullptr) // If the PickupCarrier is no Pawn, then this pickup is useless and therefore is destroyed. 204 204 return; 205 205 … … 213 213 { 214 214 CameraPosition* cameraPos = pawn->getCameraPosition(index); 215 if(cameraPos == NULL)215 if(cameraPos == nullptr) 216 216 continue; 217 217 cameraPos->setPosition(cameraPos->getPosition()/this->shrinkFactor_); … … 237 237 { 238 238 Pawn* pawn = this->carrierToPawnHelper(); 239 if(pawn == NULL) // If the PickupCarrier is no Pawn, then this pickup is useless and therefore is destroyed.239 if(pawn == nullptr) // If the PickupCarrier is no Pawn, then this pickup is useless and therefore is destroyed. 240 240 { 241 241 this->Pickupable::destroy(); … … 268 268 { 269 269 CameraPosition* cameraPos = pawn->getCameraPosition(index); 270 if(cameraPos == NULL)270 if(cameraPos == nullptr) 271 271 continue; 272 272 cameraPos->setPosition(cameraPos->getPosition()/factor); … … 277 277 { 278 278 Pawn* pawn = this->carrierToPawnHelper(); 279 if(pawn == NULL) // If the PickupCarrier is no Pawn, then this pickup is useless and therefore is destroyed.279 if(pawn == nullptr) // If the PickupCarrier is no Pawn, then this pickup is useless and therefore is destroyed. 280 280 this->Pickupable::destroy(); 281 281 … … 309 309 { 310 310 CameraPosition* cameraPos = pawn->getCameraPosition(index); 311 if(cameraPos == NULL)311 if(cameraPos == nullptr) 312 312 continue; 313 313 cameraPos->setPosition(cameraPos->getPosition()/factor); -
code/branches/cpp11_v2/src/modules/pickup/items/SpeedPickup.cc
r9667 r10765 99 99 100 100 SpaceShip* ship = this->carrierToSpaceShipHelper(); 101 if(ship == NULL) // If the PickupCarrier is no SpaceShip, then this pickup is useless and therefore is destroyed.101 if(ship == nullptr) // If the PickupCarrier is no SpaceShip, then this pickup is useless and therefore is destroyed. 102 102 this->Pickupable::destroy(); 103 103 … … 143 143 Helper to transform the PickupCarrier to a SpaceShip, and throw an error message if the conversion fails. 144 144 @return 145 A pointer to the SpaceShip, or NULLif the conversion failed.145 A pointer to the SpaceShip, or nullptr if the conversion failed. 146 146 */ 147 147 SpaceShip* SpeedPickup::carrierToSpaceShipHelper(void) … … 150 150 SpaceShip* ship = orxonox_cast<SpaceShip*>(carrier); 151 151 152 if(ship == NULL)152 if(ship == nullptr) 153 153 { 154 154 orxout(internal_error, context::pickups) << "Invalid PickupCarrier in SpeedPickup." << endl; -
code/branches/cpp11_v2/src/modules/pong/Pong.cc
r9939 r10765 103 103 void Pong::cleanup() 104 104 { 105 if (this->ball_ != NULL) // Destroy the ball, if present.105 if (this->ball_ != nullptr) // Destroy the ball, if present. 106 106 { 107 107 this->ball_->destroy(); … … 112 112 for (size_t i = 0; i < 2; ++i) 113 113 { 114 if (this->bat_[0] != NULL)114 if (this->bat_[0] != nullptr) 115 115 { 116 116 this->bat_[0]->destroy(); … … 127 127 void Pong::start() 128 128 { 129 if (this->center_ != NULL) // There needs to be a PongCenterpoint, i.e. the area the game takes place.130 { 131 if (this->ball_ == NULL) // If there is no ball, create a new ball.129 if (this->center_ != nullptr) // There needs to be a PongCenterpoint, i.e. the area the game takes place. 130 { 131 if (this->ball_ == nullptr) // If there is no ball, create a new ball. 132 132 { 133 133 this->ball_ = new PongBall(this->center_->getContext()); … … 147 147 for (size_t i = 0; i < 2; ++i) 148 148 { 149 if (this->bat_[i] == NULL)149 if (this->bat_[i] == nullptr) 150 150 { 151 151 this->bat_[i] = new PongBat(this->center_->getContext()); … … 231 231 232 232 // If the first (left) bat has no player. 233 if (this->bat_[0]->getPlayer() == NULL)233 if (this->bat_[0]->getPlayer() == nullptr) 234 234 { 235 235 player->startControl(this->bat_[0]); … … 237 237 } 238 238 // If the second (right) bat has no player. 239 else if (this->bat_[1]->getPlayer() == NULL)239 else if (this->bat_[1]->getPlayer() == nullptr) 240 240 { 241 241 player->startControl(this->bat_[1]); … … 247 247 248 248 // If the player is an AI, it receives a pointer to the ball. 249 if (player->getController() != NULL&& player->getController()->isA(Class(PongAI)))249 if (player->getController() != nullptr && player->getController()->isA(Class(PongAI))) 250 250 { 251 251 PongAI* ai = orxonox_cast<PongAI*>(player->getController()); … … 262 262 Deathmatch::playerScored(player, score); 263 263 264 if (this->center_ != NULL) // If there is a centerpoint.264 if (this->center_ != nullptr) // If there is a centerpoint. 265 265 { 266 266 // Fire an event for the player that has scored, to be able to react to it in the level, e.g. by displaying fireworks. … … 271 271 272 272 // Also announce, that the player has scored. 273 if (player != NULL)273 if (player != nullptr) 274 274 this->gtinfo_->sendAnnounceMessage(player->getName() + " scored"); 275 275 } 276 276 277 277 // If there is a ball present, reset its position, velocity and acceleration. 278 if (this->ball_ != NULL)278 if (this->ball_ != nullptr) 279 279 { 280 280 this->ball_->setPosition(Vector3::ZERO); … … 285 285 286 286 // If there are bats reset them to the middle position. 287 if (this->bat_[0] != NULL && this->bat_[1] != NULL)287 if (this->bat_[0] != nullptr && this->bat_[1] != nullptr) 288 288 { 289 289 this->bat_[0]->setPosition(-this->center_->getFieldDimension().x / 2, 0, 0); … … 292 292 293 293 // If a player gets enough points, he won the game -> end of game 294 PlayerInfo* winningPlayer = NULL;294 PlayerInfo* winningPlayer = nullptr; 295 295 if (this->getLeftPlayer() && this->getScore(this->getLeftPlayer()) >= scoreLimit_) 296 296 winningPlayer = this->getLeftPlayer(); … … 314 314 void Pong::startBall() 315 315 { 316 if (this->ball_ != NULL && this->center_ != NULL)316 if (this->ball_ != nullptr && this->center_ != nullptr) 317 317 this->ball_->setSpeed(this->center_->getBallSpeed()); 318 318 } … … 322 322 Get the left player. 323 323 @return 324 Returns a pointer to the player playing on the left. If there is no left player, NULLis returned.324 Returns a pointer to the player playing on the left. If there is no left player, nullptr is returned. 325 325 */ 326 326 PlayerInfo* Pong::getLeftPlayer() const 327 327 { 328 if (this->bat_ != NULL && this->bat_[0] != NULL)328 if (this->bat_ != nullptr && this->bat_[0] != nullptr) 329 329 return this->bat_[0]->getPlayer(); 330 330 else … … 336 336 Get the right player. 337 337 @return 338 Returns a pointer to the player playing on the right. If there is no right player, NULLis returned.338 Returns a pointer to the player playing on the right. If there is no right player, nullptr is returned. 339 339 */ 340 340 PlayerInfo* Pong::getRightPlayer() const 341 341 { 342 if (this->bat_ != NULL && this->bat_[1] != NULL)342 if (this->bat_ != nullptr && this->bat_[1] != nullptr) 343 343 return this->bat_[1]->getPlayer(); 344 344 else -
code/branches/cpp11_v2/src/modules/pong/PongAI.cc
r10727 r10765 101 101 { 102 102 // If either the ball, or the controllable entity (i.e. the bat) don't exist (or aren't set). 103 if (this->ball_ == NULL || this->getControllableEntity() == NULL)103 if (this->ball_ == nullptr || this->getControllableEntity() == nullptr) 104 104 return; 105 105 -
code/branches/cpp11_v2/src/modules/pong/PongBall.cc
r9945 r10765 163 163 float distance = 0; 164 164 165 if (this->bat_ != NULL) // If there are bats.165 if (this->bat_ != nullptr) // If there are bats. 166 166 { 167 167 // If the right boundary has been crossed. 168 if (position.x > this->fieldWidth_ / 2 && this->bat_[1] != NULL)168 if (position.x > this->fieldWidth_ / 2 && this->bat_[1] != nullptr) 169 169 { 170 170 // Calculate the distance (in z-direction) between the ball and the center of the bat, weighted by half of the effective length of the bat (with additional 10%) … … 195 195 } 196 196 // If the left boundary has been crossed. 197 else if (position.x < -this->fieldWidth_ / 2 && this->bat_[0] != NULL)197 else if (position.x < -this->fieldWidth_ / 2 && this->bat_[0] != nullptr) 198 198 { 199 199 // Calculate the distance (in z-direction) between the ball and the center of the bat, weighted by half of the effective length of the bat (with additional 10%) … … 285 285 { 286 286 // Make space for the bats, if they don't exist, yet. 287 if (this->bat_ == NULL)287 if (this->bat_ == nullptr) 288 288 { 289 289 this->bat_ = new WeakPtr<PongBat>[2]; -
code/branches/cpp11_v2/src/modules/pong/PongCenterpoint.cc
r10624 r10765 84 84 void PongCenterpoint::checkGametype() 85 85 { 86 if (this->getGametype() != NULL&& this->getGametype()->isA(Class(Pong)))86 if (this->getGametype() != nullptr && this->getGametype()->isA(Class(Pong))) 87 87 { 88 88 Pong* pongGametype = orxonox_cast<Pong*>(this->getGametype()); -
code/branches/cpp11_v2/src/modules/pong/PongScore.cc
r10624 r10765 97 97 98 98 // If the owner is set. The owner being a Pong game. 99 if (this->owner_ != NULL)99 if (this->owner_ != nullptr) 100 100 { 101 101 if (!this->owner_->hasEnded()) … … 113 113 114 114 // Save the name and score of each player as a string. 115 if (player1_ != NULL)115 if (player1_ != nullptr) 116 116 { 117 117 name1 = player1_->getName(); 118 118 score1 = multi_cast<std::string>(this->owner_->getScore(player1_)); 119 119 } 120 if (player2_ != NULL)120 if (player2_ != nullptr) 121 121 { 122 122 name2 = player2_->getName(); … … 128 128 if (this->bShowLeftPlayer_) 129 129 { 130 if (this->bShowName_ && this->bShowScore_ && player1_ != NULL)130 if (this->bShowName_ && this->bShowScore_ && player1_ != nullptr) 131 131 output1 = name1 + " - " + score1; 132 132 else if (this->bShowScore_) … … 139 139 if (this->bShowRightPlayer_) 140 140 { 141 if (this->bShowName_ && this->bShowScore_ && player2_ != NULL)141 if (this->bShowName_ && this->bShowScore_ && player2_ != nullptr) 142 142 output2 = score2 + " - " + name2; 143 143 else if (this->bShowScore_) … … 163 163 @brief 164 164 Is called when the owner changes. 165 Sets the owner to NULL, if it is not a pointer to a Pong game.165 Sets the owner to nullptr, if it is not a pointer to a Pong game. 166 166 */ 167 167 void PongScore::changedOwner() … … 169 169 SUPER(PongScore, changedOwner); 170 170 171 if (this->getOwner() != NULL&& this->getOwner()->getGametype())171 if (this->getOwner() != nullptr && this->getOwner()->getGametype()) 172 172 this->owner_ = orxonox_cast<Pong*>(this->getOwner()->getGametype()); 173 173 else -
code/branches/cpp11_v2/src/modules/portals/PortalEndPoint.cc
r9667 r10765 48 48 std::map<unsigned int, PortalEndPoint *> PortalEndPoint::idMap_s; 49 49 50 PortalEndPoint::PortalEndPoint(Context* context) : StaticEntity(context), RadarViewable(this, static_cast<WorldEntity*>(this)), id_(0), trigger_( NULL), reenterDelay_(0)50 PortalEndPoint::PortalEndPoint(Context* context) : StaticEntity(context), RadarViewable(this, static_cast<WorldEntity*>(this)), id_(0), trigger_(nullptr), reenterDelay_(0) 51 51 { 52 52 RegisterObject(PortalEndPoint); … … 70 70 PortalEndPoint::~PortalEndPoint() 71 71 { 72 if(this->isInitialized() && this->trigger_ != NULL)72 if(this->isInitialized() && this->trigger_ != nullptr) 73 73 delete this->trigger_; 74 74 } -
code/branches/cpp11_v2/src/modules/questsystem/GlobalQuest.cc
r9667 r10765 138 138 bool GlobalQuest::isStartable(const PlayerInfo* player) const 139 139 { 140 if(!(this->getParentQuest() == NULL|| this->getParentQuest()->isActive(player)))140 if(!(this->getParentQuest() == nullptr || this->getParentQuest()->isActive(player))) 141 141 return false; 142 142 … … 198 198 The status to be set. 199 199 @return 200 Returns false if player is NULL.200 Returns false if player is nullptr. 201 201 */ 202 202 bool GlobalQuest::setStatus(PlayerInfo* player, const QuestStatus::Value & status) … … 249 249 i--; 250 250 } 251 return NULL;251 return nullptr; 252 252 } 253 253 -
code/branches/cpp11_v2/src/modules/questsystem/LocalQuest.cc
r9667 r10765 128 128 bool LocalQuest::isStartable(const PlayerInfo* player) const 129 129 { 130 if(!(this->getParentQuest() == NULL|| this->getParentQuest()->isActive(player)))130 if(!(this->getParentQuest() == nullptr || this->getParentQuest()->isActive(player))) 131 131 return false; 132 132 … … 188 188 The status to be set. 189 189 @return 190 Returns false if player is NULL.190 Returns false if player is nullptr. 191 191 */ 192 192 bool LocalQuest::setStatus(PlayerInfo* player, const QuestStatus::Value & status) -
code/branches/cpp11_v2/src/modules/questsystem/Quest.cc
r10624 r10765 55 55 RegisterObject(Quest); 56 56 57 this->parentQuest_ = NULL;57 this->parentQuest_ = nullptr; 58 58 } 59 59 … … 183 183 The index. 184 184 @return 185 Returns a pointer to the sub-quest at the given index. NULLif there is no element at the given index.185 Returns a pointer to the sub-quest at the given index. nullptr if there is no element at the given index. 186 186 */ 187 187 const Quest* Quest::getSubQuest(unsigned int index) const … … 198 198 } 199 199 200 return NULL; // If the index is greater than the number of elements in the list.200 return nullptr; // If the index is greater than the number of elements in the list. 201 201 } 202 202 … … 207 207 The index. 208 208 @return 209 Returns a pointer to the QuestHint at the given index. NULLif there is no element at the given index.209 Returns a pointer to the QuestHint at the given index. nullptr if there is no element at the given index. 210 210 */ 211 211 const QuestHint* Quest::getHint(unsigned int index) const … … 221 221 i--; 222 222 } 223 return NULL; // If the index is greater than the number of elements in the list.223 return nullptr; // If the index is greater than the number of elements in the list. 224 224 } 225 225 … … 230 230 The index. 231 231 @return 232 Returns a pointer to the fail QuestEffect at the given index. NULLif there is no element at the given index.232 Returns a pointer to the fail QuestEffect at the given index. nullptr if there is no element at the given index. 233 233 */ 234 234 const QuestEffect* Quest::getFailEffect(unsigned int index) const … … 244 244 i--; 245 245 } 246 return NULL; // If the index is greater than the number of elements in the list.246 return nullptr; // If the index is greater than the number of elements in the list. 247 247 } 248 248 … … 253 253 The index. 254 254 @return 255 Returns a pointer to the complete QuestEffect at the given index. NULLif there is no element at the given index.255 Returns a pointer to the complete QuestEffect at the given index. nullptr if there is no element at the given index. 256 256 */ 257 257 const QuestEffect* Quest::getCompleteEffect(unsigned int index) const … … 267 267 i--; 268 268 } 269 return NULL; // If the index is greater than the number of elements in the list.269 return nullptr; // If the index is greater than the number of elements in the list. 270 270 } 271 271 … … 280 280 bool Quest::isInactive(const PlayerInfo* player) const 281 281 { 282 if(player == NULL)282 if(player == nullptr) 283 283 return true; 284 284 return this->getStatus(player) == QuestStatus::Inactive; … … 295 295 bool Quest::isActive(const PlayerInfo* player) const 296 296 { 297 if(player == NULL)297 if(player == nullptr) 298 298 return false; 299 299 return this->getStatus(player) == QuestStatus::Active; … … 310 310 bool Quest::isFailed(const PlayerInfo* player) const 311 311 { 312 if(player == NULL)312 if(player == nullptr) 313 313 return false; 314 314 return this->getStatus(player) == QuestStatus::Failed; … … 325 325 bool Quest::isCompleted(const PlayerInfo* player) const 326 326 { 327 if(player == NULL)327 if(player == nullptr) 328 328 return false; 329 329 return this->getStatus(player) == QuestStatus::Completed; -
code/branches/cpp11_v2/src/modules/questsystem/QuestEffectBeacon.cc
r9667 r10765 113 113 114 114 PlayerTrigger* pTrigger = orxonox_cast<PlayerTrigger*>(trigger); 115 PlayerInfo* player = NULL;115 PlayerInfo* player = nullptr; 116 116 117 117 // If the trigger is a PlayerTrigger. 118 if(pTrigger != NULL)118 if(pTrigger != nullptr) 119 119 { 120 120 if(!pTrigger->isForPlayer()) // The PlayerTrigger is not exclusively for Pawns which means we cannot extract one. … … 126 126 return false; 127 127 128 if(player == NULL)128 if(player == nullptr) 129 129 { 130 130 orxout(verbose, context::quests) << "The QuestEffectBeacon was triggered by an entity other than a Pawn. (" << trigger->getIdentifier()->getName() << ")" << endl; … … 243 243 i--; 244 244 } 245 return NULL;245 return nullptr; 246 246 } 247 247 -
code/branches/cpp11_v2/src/modules/questsystem/QuestHint.cc
r9667 r10765 88 88 bool QuestHint::isActive(const PlayerInfo* player) const 89 89 { 90 if(player == NULL) // If the player is NULL, the Quest obviously can't be active.90 if(player == nullptr) // If the player is nullptr, the Quest obviously can't be active. 91 91 return false; 92 92 -
code/branches/cpp11_v2/src/modules/questsystem/QuestListener.cc
r9667 r10765 59 59 60 60 this->mode_ = QuestListenerMode::All; 61 this->quest_ = NULL;61 this->quest_ = nullptr; 62 62 } 63 63 … … 81 81 XMLPortParam(QuestListener, "mode", setMode, getMode, xmlelement, mode); 82 82 83 if(this->quest_ != NULL)83 if(this->quest_ != nullptr) 84 84 this->quest_->addListener(this); // Adds the QuestListener to the Quests list of listeners. 85 85 … … 117 117 this->quest_ = QuestManager::getInstance().findQuest(id); // Find the Quest corresponding to the given questId. 118 118 119 if(this->quest_ == NULL) // If there is no such Quest.119 if(this->quest_ == nullptr) // If there is no such Quest. 120 120 { 121 121 ThrowException(Argument, "This is bad! The QuestListener has not found a Quest with a corresponding id.."); -
code/branches/cpp11_v2/src/modules/questsystem/QuestManager.cc
r10624 r10765 93 93 bool QuestManager::registerQuest(Quest* quest) 94 94 { 95 if(quest == NULL)96 { 97 orxout(internal_error, context::quests) << "Quest pointer is NULL." << endl;95 if(quest == nullptr) 96 { 97 orxout(internal_error, context::quests) << "Quest pointer is nullptr." << endl; 98 98 return false; 99 99 } … … 135 135 bool QuestManager::registerHint(QuestHint* hint) 136 136 { 137 if(hint == NULL)138 { 139 orxout(internal_error, context::quests) << "Quest pointer is NULL." << endl;137 if(hint == nullptr) 138 { 139 orxout(internal_error, context::quests) << "Quest pointer is nullptr." << endl; 140 140 return false; 141 141 } … … 173 173 @return 174 174 Returns a pointer to the Quest with the input id. 175 Returns NULLif there is no Quest with the given questId.175 Returns nullptr if there is no Quest with the given questId. 176 176 @throws 177 177 Throws an exception if the given questId is invalid. … … 188 188 else 189 189 { 190 quest = NULL;190 quest = nullptr; 191 191 orxout(internal_warning, context::quests) << "The quest with id {" << questId << "} is nowhere to be found." << endl; 192 192 } … … 202 202 @return 203 203 Returns a pointer to the QuestHint with the input id. 204 Returns NULLif there is no QuestHint with the given hintId.204 Returns nullptr if there is no QuestHint with the given hintId. 205 205 @throws 206 206 Throws an exception if the given hintId is invalid. … … 217 217 else 218 218 { 219 hint = NULL;219 hint = nullptr; 220 220 orxout(internal_warning, context::quests) << "The hint with id {" << hintId << "} is nowhere to be found." << endl; 221 221 } … … 237 237 for(std::map<std::string, Quest*>::iterator it = this->questMap_.begin(); it != this->questMap_.end(); it++) 238 238 { 239 if(it->second->getParentQuest() == NULL&& !it->second->isInactive(player))239 if(it->second->getParentQuest() == nullptr && !it->second->isInactive(player)) 240 240 numQuests++; 241 241 } … … 257 257 for(std::map<std::string, Quest*>::iterator it = this->questMap_.begin(); it != this->questMap_.end(); it++) 258 258 { 259 if(it->second->getParentQuest() == NULL&& !it->second->isInactive(player) && index-- == 0)259 if(it->second->getParentQuest() == nullptr && !it->second->isInactive(player) && index-- == 0) 260 260 return it->second; 261 261 } 262 return NULL;262 return nullptr; 263 263 } 264 264 … … 275 275 int QuestManager::getNumSubQuests(Quest* quest, PlayerInfo* player) 276 276 { 277 if(quest == NULL)277 if(quest == nullptr) 278 278 return this->getNumRootQuests(player); 279 279 … … 300 300 Quest* QuestManager::getSubQuest(Quest* quest, PlayerInfo* player, int index) 301 301 { 302 if(quest == NULL)302 if(quest == nullptr) 303 303 return this->getRootQuest(player, index); 304 304 … … 309 309 return *it; 310 310 } 311 return NULL;311 return nullptr; 312 312 } 313 313 … … 354 354 return *it; 355 355 } 356 return NULL;356 return nullptr; 357 357 } 358 358 … … 367 367 Quest* QuestManager::getParentQuest(Quest* quest) 368 368 { 369 OrxAssert(quest, "The input Quest is NULL.");369 OrxAssert(quest, "The input Quest is nullptr."); 370 370 return quest->getParentQuest(); 371 371 } … … 381 381 QuestDescription* QuestManager::getDescription(Quest* item) 382 382 { 383 OrxAssert(item, "The input Quest is NULL.");383 OrxAssert(item, "The input Quest is nullptr."); 384 384 return item->getDescription(); 385 385 } … … 395 395 QuestDescription* QuestManager::getDescription(QuestHint* item) 396 396 { 397 OrxAssert(item, "The input QuestHint is NULL.");397 OrxAssert(item, "The input QuestHint is nullptr."); 398 398 return item->getDescription(); 399 399 } … … 409 409 const std::string QuestManager::getId(Quest* item) const 410 410 { 411 OrxAssert(item, "The input Quest is NULL.");411 OrxAssert(item, "The input Quest is nullptr."); 412 412 return item->getId(); 413 413 } … … 423 423 const std::string QuestManager::getId(QuestHint* item) const 424 424 { 425 OrxAssert(item, "The input QuestHint is NULL.");425 OrxAssert(item, "The input QuestHint is nullptr."); 426 426 return item->getId(); 427 427 } … … 440 440 { 441 441 PlayerInfo* player = GUIManager::getInstance().getPlayer(guiName); 442 if(player == NULL)442 if(player == nullptr) 443 443 { 444 444 orxout(internal_error, context::quests) << "GUIOverlay with name '" << guiName << "' has no player." << endl; 445 return NULL;445 return nullptr; 446 446 } 447 447 -
code/branches/cpp11_v2/src/modules/questsystem/effects/AddQuest.cc
r9667 r10765 90 90 { 91 91 Quest* quest = QuestManager::getInstance().findQuest(this->getQuestId()); 92 if(quest == NULL|| !quest->start(player))92 if(quest == nullptr || !quest->start(player)) 93 93 return false; 94 94 } -
code/branches/cpp11_v2/src/modules/questsystem/effects/AddQuestHint.cc
r9667 r10765 113 113 { 114 114 QuestHint* hint = QuestManager::getInstance().findHint(this->hintId_); 115 if(hint == NULL|| !hint->setActive(player))115 if(hint == nullptr || !hint->setActive(player)) 116 116 return false; 117 117 } -
code/branches/cpp11_v2/src/modules/questsystem/effects/AddReward.cc
r9667 r10765 90 90 i--; 91 91 } 92 return NULL;92 return nullptr; 93 93 } 94 94 -
code/branches/cpp11_v2/src/modules/questsystem/effects/CompleteQuest.cc
r9667 r10765 92 92 { 93 93 quest = QuestManager::getInstance().findQuest(this->getQuestId()); 94 if(quest == NULL|| !quest->complete(player))94 if(quest == nullptr || !quest->complete(player)) 95 95 return false; 96 96 } -
code/branches/cpp11_v2/src/modules/questsystem/effects/FailQuest.cc
r9667 r10765 91 91 { 92 92 quest = QuestManager::getInstance().findQuest(this->getQuestId()); 93 if(quest == NULL|| !quest->fail(player))93 if(quest == nullptr || !quest->fail(player)) 94 94 return false; 95 95 } -
code/branches/cpp11_v2/src/modules/tetris/Tetris.cc
r10624 r10765 72 72 this->starttimer_.stopTimer(); 73 73 74 this->player_ = NULL;74 this->player_ = nullptr; 75 75 this->setHUDTemplate("TetrisHUD"); 76 76 this->futureBrick_ = 0; … … 113 113 SUPER(Tetris, tick, dt); 114 114 115 if((this->activeBrick_ != NULL)&&(!this->hasEnded()))115 if((this->activeBrick_ != nullptr)&&(!this->hasEnded())) 116 116 { 117 117 if(!this->isValidBrickPosition(this->activeBrick_)) … … 290 290 void Tetris::start() 291 291 { 292 if (this->center_ != NULL) // There needs to be a TetrisCenterpoint, i.e. the area the game takes place.292 if (this->center_ != nullptr) // There needs to be a TetrisCenterpoint, i.e. the area the game takes place. 293 293 { 294 294 // Create the first brick. … … 323 323 { 324 324 this->activeBrick_->setVelocity(Vector3::ZERO); 325 if(this->activeBrick_ != NULL)325 if(this->activeBrick_ != nullptr) 326 326 { 327 327 this->player_->stopControl(); … … 351 351 if(player && player->isHumanPlayer()) 352 352 { 353 if(this->activeBrick_ != NULL)353 if(this->activeBrick_ != nullptr) 354 354 { 355 355 this->player_->stopControl(); … … 370 370 assert(player); 371 371 372 if(this->player_ == NULL)372 if(this->player_ == nullptr) 373 373 { 374 374 this->player_ = player; … … 381 381 void Tetris::startBrick(void) 382 382 { 383 if(this->player_ == NULL)383 if(this->player_ == nullptr) 384 384 return; 385 385 386 386 unsigned int cameraIndex = 0; 387 if(this->activeBrick_ != NULL)387 if(this->activeBrick_ != nullptr) 388 388 { 389 389 // Get camera settings … … 437 437 Get the player. 438 438 @return 439 Returns a pointer to the player. If there is no player, NULLis returned.439 Returns a pointer to the player. If there is no player, nullptr is returned. 440 440 */ 441 441 PlayerInfo* Tetris::getPlayer(void) const -
code/branches/cpp11_v2/src/modules/tetris/TetrisBrick.cc
r10624 r10765 81 81 this->attach(stone); 82 82 this->formBrick(stone, i); 83 if(this->tetris_ != NULL)83 if(this->tetris_ != nullptr) 84 84 { 85 85 stone->setGame(this->tetris_); 86 if(this->tetris_->getCenterpoint() != NULL)86 if(this->tetris_->getCenterpoint() != nullptr) 87 87 stone->addTemplate(this->tetris_->getCenterpoint()->getStoneTemplate()); 88 88 else 89 orxout()<< "tetris_->getCenterpoint == NULLin TetrisBrick.cc"<< endl;89 orxout()<< "tetris_->getCenterpoint == nullptr in TetrisBrick.cc"<< endl; 90 90 } 91 91 else 92 orxout()<< "tetris_ == NULLin TetrisBrick.cc"<< endl;92 orxout()<< "tetris_ == nullptr in TetrisBrick.cc"<< endl; 93 93 } 94 94 } … … 161 161 if(i < this->brickStones_.size()) 162 162 return this->brickStones_[i]; 163 else return NULL;163 else return nullptr; 164 164 } 165 165 … … 167 167 Tetris* TetrisBrick::getTetris() 168 168 { 169 if (this->getGametype() != NULL&& this->getGametype()->isA(Class(Tetris)))169 if (this->getGametype() != nullptr && this->getGametype()->isA(Class(Tetris))) 170 170 { 171 171 Tetris* tetrisGametype = orxonox_cast<Tetris*>(this->getGametype()); 172 172 return tetrisGametype; 173 173 } 174 return NULL;174 return nullptr; 175 175 } 176 176 -
code/branches/cpp11_v2/src/modules/tetris/TetrisCenterpoint.cc
r10624 r10765 84 84 void TetrisCenterpoint::checkGametype() 85 85 { 86 if (this->getGametype() != NULL&& this->getGametype()->isA(Class(Tetris)))86 if (this->getGametype() != nullptr && this->getGametype()->isA(Class(Tetris))) 87 87 { 88 88 Tetris* tetrisGametype = orxonox_cast<Tetris*>(this->getGametype()); -
code/branches/cpp11_v2/src/modules/tetris/TetrisScore.cc
r10624 r10765 57 57 58 58 this->owner_ = 0; 59 this->player_ = NULL;59 this->player_ = nullptr; 60 60 } 61 61 … … 89 89 90 90 // If the owner is set. The owner being a Tetris game. 91 if (this->owner_ != NULL)91 if (this->owner_ != nullptr) 92 92 { 93 93 std::string score("0"); … … 101 101 { 102 102 // Save the name and score of each player as a string. 103 if (player_ != NULL)103 if (player_ != nullptr) 104 104 score = multi_cast<std::string>(this->owner_->getScore(player_)); 105 105 } … … 111 111 @brief 112 112 Is called when the owner changes. 113 Sets the owner to NULL, if it is not a pointer to a Tetris game.113 Sets the owner to nullptr, if it is not a pointer to a Tetris game. 114 114 */ 115 115 void TetrisScore::changedOwner() … … 117 117 SUPER(TetrisScore, changedOwner); 118 118 119 if (this->getOwner() != NULL&& this->getOwner()->getGametype())119 if (this->getOwner() != nullptr && this->getOwner()->getGametype()) 120 120 this->owner_ = orxonox_cast<Tetris*>(this->getOwner()->getGametype()); 121 121 else -
code/branches/cpp11_v2/src/modules/towerdefense/TowerDefense.cc
r10727 r10765 90 90 RegisterObject(TowerDefense); 91 91 92 selecter = NULL;93 this->player_ = NULL;92 selecter = nullptr; 93 this->player_ = nullptr; 94 94 this->setHUDTemplate("TowerDefenseHUD"); 95 95 this->waveNumber_ = 0; … … 117 117 void TowerDefense::start() 118 118 { 119 if (center_ != NULL) // There needs to be a TowerDefenseCenterpoint, i.e. the area the game takes place.120 { 121 if (selecter == NULL)119 if (center_ != nullptr) // There needs to be a TowerDefenseCenterpoint, i.e. the area the game takes place. 120 { 121 if (selecter == nullptr) 122 122 { 123 123 selecter = new TowerDefenseSelecter(this->center_->getContext()); … … 176 176 WaypointController* controller = (WaypointController*)(en1->getXMLController()); 177 177 178 if (controller != NULL&& waypoints_.size() > 1)178 if (controller != nullptr && waypoints_.size() > 1) 179 179 { 180 180 en1->setPosition(waypoints_.at(0)->getPosition() + offset_); … … 208 208 player_ = player; 209 209 210 if (selecter->getPlayer() == NULL)210 if (selecter->getPlayer() == nullptr) 211 211 { 212 212 player_->startControl(selecter); … … 219 219 Get the player. 220 220 @return 221 Returns a pointer to the player. If there is no player, NULLis returned.221 Returns a pointer to the player. If there is no player, nullptr is returned. 222 222 */ 223 223 PlayerInfo* TowerDefense::getPlayer(void) const … … 265 265 SUPER(TowerDefense, tick, dt); 266 266 267 if (hasStarted() == false || player_ == NULL)267 if (hasStarted() == false || player_ == nullptr) 268 268 { 269 269 return; … … 273 273 274 274 //build/upgrade tower at selecter position 275 if (selecter != NULL&& selecter->buildTower_ == true)275 if (selecter != nullptr && selecter->buildTower_ == true) 276 276 { 277 277 selecter->buildTower_ = false; … … 289 289 for (std::list<WeakPtr<TowerDefenseEnemy> >::iterator it = enemies_.begin(); it != enemies_.end(); ) 290 290 { 291 if (*it == NULL)291 if (*it == nullptr) 292 292 { 293 293 // the enemy was destroyed by a tower - remove it from the list … … 365 365 TDCoordinate* thisCoord = &startCoord; 366 366 TDCoordinate* nextCoord; 367 while ((nextCoord = getNextStreetCoord(thisCoord)) != NULL)367 while ((nextCoord = getNextStreetCoord(thisCoord)) != nullptr) 368 368 { 369 369 waypoints_.push_back(fields_[nextCoord->GetX()][nextCoord->GetY()]); … … 381 381 if (thisField->getType() != STREET && thisField->getType() != START) 382 382 { 383 return NULL;383 return nullptr; 384 384 } 385 385 … … 406 406 } 407 407 408 return NULL;408 return nullptr; 409 409 } 410 410 } -
code/branches/cpp11_v2/src/modules/towerdefense/TowerDefenseCenterpoint.cc
r10629 r10765 92 92 void TowerDefenseCenterpoint::checkGametype() 93 93 { 94 if (this->getGametype() != NULL&& this->getGametype()->isA(Class(TowerDefense)))94 if (this->getGametype() != nullptr && this->getGametype()->isA(Class(TowerDefense))) 95 95 { 96 96 // Sets the centerpoint of the gametype. The gametype uses this to later spawn in towers, he needs the tower template stored in the center point -
code/branches/cpp11_v2/src/modules/towerdefense/TowerDefenseEnemy.cc
r10629 r10765 47 47 WeakPtr<TowerDefense> TowerDefenseEnemy::getGame() 48 48 { 49 if (game == NULL)49 if (game == nullptr) 50 50 { 51 51 for (ObjectList<TowerDefense>::iterator it = ObjectList<TowerDefense>::begin(); it != ObjectList<TowerDefense>::end(); ++it) -
code/branches/cpp11_v2/src/modules/towerdefense/TowerDefenseField.cc
r10629 r10765 49 49 RegisterObject(TowerDefenseField); 50 50 51 tower_ = NULL;51 tower_ = nullptr; 52 52 type_ = FREE; 53 center_ = NULL;53 center_ = nullptr; 54 54 upgrade_ = 0; 55 55 setPosition(0,0,0); … … 119 119 bool TowerDefenseField::canUpgrade() 120 120 { 121 if (tower_ != NULL&& upgrade_ < 5)121 if (tower_ != nullptr && upgrade_ < 5) 122 122 { 123 123 return true; … … 129 129 void TowerDefenseField::setAngle(int newAngle) 130 130 { 131 if (modelGround_ != NULL)131 if (modelGround_ != nullptr) 132 132 { 133 133 switch (newAngle) … … 152 152 } 153 153 154 if (modelObject_ != NULL)154 if (modelObject_ != nullptr) 155 155 { 156 156 switch (newAngle) … … 185 185 { 186 186 modelGround_->setMeshSource("TD_F1.mesh"); 187 tower_ = NULL;187 tower_ = nullptr; 188 188 type_ = FREE; 189 189 setUpgrade(0); … … 194 194 { 195 195 modelGround_->setMeshSource("TD_S5.mesh"); 196 tower_ = NULL;196 tower_ = nullptr; 197 197 type_ = START; 198 198 setUpgrade(0); … … 204 204 { 205 205 modelGround_->setMeshSource("TD_S4.mesh"); 206 tower_ = NULL;206 tower_ = nullptr; 207 207 type_ = END; 208 208 setUpgrade(0); … … 213 213 { 214 214 modelGround_->setMeshSource("TD_S1.mesh"); 215 tower_ = NULL;215 tower_ = nullptr; 216 216 type_ = STREET; 217 217 setUpgrade(0); … … 222 222 { 223 223 modelGround_->setMeshSource("TD_S2.mesh"); 224 tower_ = NULL;224 tower_ = nullptr; 225 225 type_ = STREET; 226 226 setUpgrade(0); … … 231 231 { 232 232 modelGround_->setMeshSource("TD_S3.mesh"); 233 tower_ = NULL;233 tower_ = nullptr; 234 234 type_ = STREET; 235 235 setUpgrade(0); … … 241 241 modelGround_->setMeshSource("TD_F1.mesh"); 242 242 modelObject_->setMeshSource("TD_O1.mesh"); 243 tower_ = NULL;243 tower_ = nullptr; 244 244 type_ = OBSTACLE; 245 245 setUpgrade(0); … … 249 249 void TowerDefenseField::createTower(int upgrade) 250 250 { 251 if (tower_ == NULL)251 if (tower_ == nullptr) 252 252 { 253 253 modelGround_->setMeshSource("TD_F1.mesh"); … … 256 256 type_ = TOWER; 257 257 setUpgrade(upgrade); 258 if (upgrade_ > 0 && modelObject_ != NULL)258 if (upgrade_ > 0 && modelObject_ != nullptr) 259 259 { 260 260 switch (upgrade_) … … 287 287 void TowerDefenseField::destroyTower() 288 288 { 289 if (tower_ != NULL)289 if (tower_ != nullptr) 290 290 { 291 291 tower_->destroy(); 292 tower_ = NULL;292 tower_ = nullptr; 293 293 } 294 294 } -
code/branches/cpp11_v2/src/modules/towerdefense/TowerDefenseTower.cc
r10727 r10765 25 25 { 26 26 RegisterObject(TowerDefenseTower); 27 game_ = NULL;27 game_ =nullptr; 28 28 this->setCollisionType(WorldEntity::None); 29 29 upgrade = 1; -
code/branches/cpp11_v2/src/modules/weapons/IceGunFreezer.cc
r10629 r10765 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_v2/src/modules/weapons/projectiles/BasicProjectile.cc
r10293 r10765 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_v2/src/modules/weapons/projectiles/GravityBombField.cc
r10622 r10765 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);139 it->hit(shooter_, it->getWorldPosition(), nullptr, damage, 0,0); 140 140 victimsAlreadyDamaged_.push_back(*it); 141 141 } -
code/branches/cpp11_v2/src/modules/weapons/projectiles/Projectile.cc
r10629 r10765 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);
Note: See TracChangeset
for help on using the changeset viewer.