[Orxonox-commit 7750] r12343 - code/branches/OrxoBlox_FS19/src/modules/OrxoBlox

ahuwyler at orxonox.net ahuwyler at orxonox.net
Thu May 9 11:09:18 CEST 2019


Author: ahuwyler
Date: 2019-05-09 11:09:18 +0200 (Thu, 09 May 2019)
New Revision: 12343

Modified:
   code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBlox.cc
   code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBlox.h
Log:
We have a list of all stones

Modified: code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBlox.cc
===================================================================
--- code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBlox.cc	2019-05-09 08:46:20 UTC (rev 12342)
+++ code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBlox.cc	2019-05-09 09:09:18 UTC (rev 12343)
@@ -112,16 +112,10 @@
                 this->futureWall_ = nullptr;
             }
 
-        // Destroy 6 bWalls, if present.
-        for (size_t i = 0; i < 6; ++i)
-        {
-            if (this->activeWalls_[0] != nullptr)
-            {
-                this->activeWalls_[0]->destroy();
-                this->activeWalls_[0] = nullptr;
-            }
-            
-        }
+        for (OrxoBloxStones* stone : this->stones_)
+            stone->destroy();
+        this->stones_.clear();
+        
 
     }
 
@@ -214,14 +208,10 @@
 
     }
 
-    //void startWall(void);
     void OrxoBlox::LevelUp(){
         level_++;
-        for(int i=8; i>-1; --i){
-            activeWalls_[i]=activeWalls_[i+1];
-        }
         this->createWall();
-        //activeWalls_[0]=
+        //this->activeWalls_.push_back(this->futureWall_);
         //When levelup? wo wird es ausgeloest?
         //new location of ship
         //new amount of balls
@@ -238,8 +228,9 @@
         // Attach the brick to the Centerpoint and set the position of the brick to be at the left side.
         this->center_->attach(this->futureWall_);
         
-        
-        this->futureWall_->setPosition(0, 0, 0.0f);
+        float y_=(this->center_->getFieldDimension()).y;
+                //stone->setPosition(size_*i -x_/2 +4.5f, -3.5f, -y_/2 + 6.5f);
+        this->futureWall_->setPosition(0, 0, -y_/2 + 6.5f);
         this->futureWall_->setGame(this);
     }
 

Modified: code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBlox.h
===================================================================
--- code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBlox.h	2019-05-09 08:46:20 UTC (rev 12342)
+++ code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBlox.h	2019-05-09 09:09:18 UTC (rev 12343)
@@ -97,13 +97,15 @@
             WeakPtr<OrxoBloxCenterpoint> center_; //!< The playing field.
             WeakPtr<OrxoBloxBall> ball_; //!< The OrxoBlox ball.
             unsigned int level_;
-            
+
             WeakPtr<OrxoBloxShip> playership;
             PlayerInfo* player_;
             Timer starttimer_; //!< A timer to delay the start of the game.
             
             WeakPtr<OrxoBloxWall> futureWall_;
-            WeakPtr<OrxoBloxWall> activeWalls_[6]; //6 is the number of wallls in the game.
+            std::vector<OrxoBloxWall*> activeWalls_;
+            std::list<StrongPtr<OrxoBloxStones>> stones_; //!< A list of all stones in play.
+
     };
 }
 



More information about the Orxonox-commit mailing list