Index: code/trunk/src/modules/towerdefense/TowerDefense.cc
===================================================================
--- code/trunk/src/modules/towerdefense/TowerDefense.cc	(revision 10727)
+++ code/trunk/src/modules/towerdefense/TowerDefense.cc	(revision 11071)
@@ -90,6 +90,6 @@
         RegisterObject(TowerDefense);
 
-        selecter = NULL;
-        this->player_ = NULL;        
+        selecter = nullptr;
+        this->player_ = nullptr;
         this->setHUDTemplate("TowerDefenseHUD");
         this->waveNumber_ = 0;
@@ -117,7 +117,7 @@
     void TowerDefense::start()
     {        
-        if (center_ != NULL) // There needs to be a TowerDefenseCenterpoint, i.e. the area the game takes place.
-        {
-            if (selecter == NULL)
+        if (center_ != nullptr) // There needs to be a TowerDefenseCenterpoint, i.e. the area the game takes place.
+        {
+            if (selecter == nullptr)
             {
                 selecter = new TowerDefenseSelecter(this->center_->getContext());                
@@ -176,5 +176,5 @@
         WaypointController* controller = (WaypointController*)(en1->getXMLController());
 
-        if (controller != NULL && waypoints_.size() > 1)
+        if (controller != nullptr && waypoints_.size() > 1)
         {
             en1->setPosition(waypoints_.at(0)->getPosition() + offset_);
@@ -183,8 +183,8 @@
             en1->lookAt(waypoints_.at(1)->getPosition() + offset_);
 
-            for (unsigned int i = 0; i < waypoints_.size(); ++ i)
+            for (TowerDefenseField* field : waypoints_)
             {
                 orxonox::WeakPtr<MovableEntity> waypoint = new MovableEntity(this->center_->getContext());
-                waypoint->setPosition(waypoints_.at(i)->getPosition() + offset_);
+                waypoint->setPosition(field->getPosition() + offset_);
                 controller->addWaypoint(waypoint);
             }
@@ -208,5 +208,5 @@
         player_ = player;
 
-        if (selecter->getPlayer() == NULL)
+        if (selecter->getPlayer() == nullptr)
         {
             player_->startControl(selecter);
@@ -219,5 +219,5 @@
         Get the player.
     @return
-        Returns a pointer to the player. If there is no player, NULL is returned.
+        Returns a pointer to the player. If there is no player, nullptr is returned.
     */
     PlayerInfo* TowerDefense::getPlayer(void) const
@@ -265,5 +265,5 @@
         SUPER(TowerDefense, tick, dt);
 
-        if (hasStarted() == false || player_ == NULL)
+        if (hasStarted() == false || player_ == nullptr)
         {
             return;
@@ -273,5 +273,5 @@
 
         //build/upgrade tower at selecter position
-        if (selecter != NULL && selecter->buildTower_ == true)
+        if (selecter != nullptr && selecter->buildTower_ == true)
         {
             selecter->buildTower_ = false;
@@ -287,7 +287,7 @@
         }
         
-        for (std::list<WeakPtr<TowerDefenseEnemy> >::iterator it = enemies_.begin(); it != enemies_.end(); )
-        {
-            if (*it == NULL)
+        for (std::list<WeakPtr<TowerDefenseEnemy>>::iterator it = enemies_.begin(); it != enemies_.end(); )
+        {
+            if (*it == nullptr)
             {
                 // the enemy was destroyed by a tower - remove it from the list
@@ -355,5 +355,5 @@
                 fields_[i][j]->create(fields.at(pos), fields.at(pos+1));
                 pos += 2;
-                if (fields_[i][j]->getType() == START)
+                if (fields_[i][j]->getType() == TowerDefenseFieldType::START)
                 {
                     startCoord.Set(i,j);
@@ -365,5 +365,5 @@
         TDCoordinate* thisCoord = &startCoord;
         TDCoordinate* nextCoord;
-        while ((nextCoord = getNextStreetCoord(thisCoord)) != NULL)
+        while ((nextCoord = getNextStreetCoord(thisCoord)) != nullptr)
         {
             waypoints_.push_back(fields_[nextCoord->GetX()][nextCoord->GetY()]);            
@@ -379,7 +379,7 @@
         TDCoordinate* nextCoord = new TDCoordinate(0,0);
 
-        if (thisField->getType() != STREET && thisField->getType() != START)
-        {
-            return NULL;
+        if (thisField->getType() != TowerDefenseFieldType::STREET && thisField->getType() != TowerDefenseFieldType::START)
+        {
+            return nullptr;
         }
 
@@ -406,5 +406,5 @@
         }
 
-        return NULL;
+        return nullptr;
     }
 }
